Add interaactive context change

This commit is contained in:
stephan
2020-03-12 14:48:58 +01:00
parent db7ccb2b11
commit 5c134dd8c5
3 changed files with 53 additions and 20 deletions

View File

@ -68,11 +68,16 @@ class QueryForm(FlaskForm):
validators=[DataRequired()])
context = SelectField('Context',
choices=[('', 'Words of context around hit'),
('5', '5'),
('10', '10'),
('15', '15'),
('20', '20'),
('25', '25')],
('30', '30'),
('40', '40'),
('50', '50'),
('60', '60'),
('70', '70'),
('80', '80'),
('90', '90'),
('100', '100')],
validators=[DataRequired()])
submit = SubmitField('Start Query')

View File

@ -56,7 +56,7 @@ def analyse_corpus(corpus_id):
corpus.status = 'start analysis'
db.session.commit()
query_download_form = QueryDownloadForm()
query_form = QueryForm(context=request.args.get('context', 10),
query_form = QueryForm(context=request.args.get('context', 20),
hits_per_page=request.args.get('hits_per_page', 30),
query=request.args.get('query'))
return render_template('corpora/analyse_corpus.html.j2',