Compare commits
No commits in common. "e4782173439759a62b4c595f2ccd27cb79a12890" and "370a215d0811d580e41189398c33c33594bbc581" have entirely different histories.
e478217343
...
370a215d08
|
@ -4,7 +4,6 @@
|
|||
###########################################################################
|
||||
from flask import abort, jsonify
|
||||
from markupsafe import escape
|
||||
from collections import Counter
|
||||
from Login import *
|
||||
from Article import *
|
||||
import Yaml
|
||||
|
@ -59,12 +58,6 @@ def appears_in_test(word, d):
|
|||
else:
|
||||
return ','.join(d[word])
|
||||
|
||||
|
||||
def good_word(word):
|
||||
return len(word) < len('Pneumonoultramicroscopicsilicovolcanoconiosis') \
|
||||
and Counter(word).most_common(1)[0][1] <= 4
|
||||
|
||||
|
||||
@app.route("/mark", methods=['GET', 'POST'])
|
||||
def mark_word():
|
||||
'''
|
||||
|
@ -106,7 +99,7 @@ def mainpage():
|
|||
if request.method == 'POST': # when we submit a form
|
||||
content = escape(request.form['content'])
|
||||
f = WordFreq(content)
|
||||
lst = [ t for t in f.get_freq() if good_word(t[0]) ] # only keep normal words
|
||||
lst = f.get_freq()
|
||||
# save history
|
||||
d = load_freq_history(path_prefix + 'static/frequency/frequency.p')
|
||||
lst_history = pickle_idea.dict2lst(d)
|
||||
|
|
Loading…
Reference in New Issue