def spellcheck(): if request.method == "POST": raw = request.form["raw"] if len(raw) != 0: ret = nlp.spellcheck(raw) if ret is None: return jsonift(error="Can't do spellcheck!") return jsonify(results=ret) else: return render_template("spellcheck.html")
def spellcheck(filename): with open(filename, 'rU') as f: return {filename:nlp.spellcheck(f.read())}