mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-06-12 17:10:41 +00:00
New context options
This commit is contained in:
@ -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}
|
||||
|
@ -1,7 +1,7 @@
|
||||
from flask_wtf import FlaskForm
|
||||
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):
|
||||
@ -88,19 +88,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):
|
||||
|
Reference in New Issue
Block a user