Merge branch 'development' of gitlab.ub.uni-bielefeld.de:sfb1288inf/opaque into development

This commit is contained in:
Patrick Jentsch
2020-04-15 14:57:19 +02:00
4 changed files with 133 additions and 80 deletions

View File

@ -93,7 +93,7 @@ def corpus_analysis_inspect_match(payload):
try:
corpus = client.corpora.get('CORPUS')
s = corpus.structural_attributes.get('s')
payload = s.export(payload['first_cpos'], payload['last_cpos'], context=3)
payload = s.export(payload['first_cpos'], payload['last_cpos'], context=10)
payload['cpos_ranges'] = True
except cqi.errors.CQiException as e:
payload = {'code': e.code, 'desc': e.description, 'msg': e.name}

View File

@ -2,7 +2,7 @@ from flask_wtf import FlaskForm
from werkzeug.utils import secure_filename
from wtforms import (BooleanField, FileField, StringField, SubmitField,
ValidationError, IntegerField, SelectField)
from wtforms.validators import DataRequired, Length
from wtforms.validators import DataRequired, Length, NumberRange
class AddCorpusFileForm(FlaskForm):
@ -97,19 +97,9 @@ class DisplayOptionsForm(FlaskForm):
class InspectDisplayOptionsForm(FlaskForm):
expert_mode_inspect = BooleanField('Expert mode')
highlight_sentences = BooleanField('Highlight sentences')
context_sentences = SelectField('Context sentences',
choices=[('', 'Choose your option'),
('1', '1'),
('2', '2'),
('3', '3'),
('4', '4'),
('5', '5'),
('6', '6'),
('7', '7'),
('8', '8'),
('9', '9'),
('10', '10')],
default=3)
context_sentences = IntegerField('Context sentences',
validators=[NumberRange(min=0, max=10)],
default=3)
class QueryDownloadForm(FlaskForm):