<commit_before>import os
from dice import Roll
from flask import Flask, render_template, request, redirect, url_for, jsonify

app = Flask(__name__)

@app.route('/')
def roller():
	rollString=request.args.get('text') if request.args.has_key('text') else request.args.get('roll',"1d6")
	if rollString[0]=="'" or rollString[0]=='"':
		rollString=rollString[2:-1]
	# return str(Roll(rollString).roll())
	dice = Roll(rollString)
	response = {
	"response_type" : "in_channel",
	"text": "You rolled %s and got: %s" % (rollString, str(dice.roll())),
	"attachments":[
	    {
	    "text": "%s + %d" % (str(dice.results), dice.plus)
	    }<commit_msg>making response a bit smarter about display<commit_after>import os
from dice import Roll
from flask import Flask, render_template, request, redirect, url_for, jsonify

app = Flask(__name__)

@app.route('/')
def roller():
	rollString=request.args.get('text') if request.args.has_key('text') else request.args.get('roll',"1d6")
	if rollString[0]=="'" or rollString[0]=='"':
		rollString=rollString[2:-1]
	# return str(Roll(rollString).roll())
	dice = Roll(rollString)
	response = {
	"response_type" : "in_channel",
	"text": "Rolled %s and got: %s" % (rollString, str(dice.roll())),
	"attachments":[
	    {
	    "text": "%s + %d" % (str(dice.results), dice.plus) if dice.plus > 0 else str(dice.results)
	    }
{'fraction_non_alphanumeric': 0.1849925705794948, 'fraction_numerical': 0.009658246656760773, 'mean_word_length': 5.178899082568807, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5236596', 'n_tokens_mistral': 503, 'n_tokens_neox': 485, 'n_words': 114}