from wtforms.validators import Required from whoosh.index import create_in from whoosh.qparser import QueryParser from whoosh.fields import Schema, TEXT, STORED import whoosh.index as index import sys sys.path.append("..") import insummer from insummer.summarization.ilp import dis_ilp as DI from insummer.common_type import Question, Answer, build_question from insummer.util import NLP nlp = NLP() app = Flask(__name__) Bootstrap(app) # in a real app, these should be configured through Flask-Appconfig app.config['SECRET_KEY'] = 'devkey' app.config['RECAPTCHA_PUBLIC_KEY'] = \ '6Lfol9cSAAAAADAkodaYl9wvQCwBMr3qGR_PPHcw' class search_form(Form): name = StringField('', validators=[DataRequired()]) index_dir = "/home/lavi/project/insummer/index"
def test_norm_text(self): nlp = NLP() self.assertEqual(nlp.norm_text('dogs'), 'dog', '测试归一化句子')