From 74bcb2d2ba9e5cb46e314700d5c565da86c3597d Mon Sep 17 00:00:00 2001 From: Bartłomiej Nitoń <bartomiej@raven.(none)> Date: Wed, 14 Oct 2015 16:22:56 +0200 Subject: [PATCH] TEI generation bugfix. --- dictionary/models.py | 3 +++ dictionary/teixml.py | 2 +- semantics/validation.py | 6 +++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/dictionary/models.py b/dictionary/models.py index 68350a7..a921c6a 100644 --- a/dictionary/models.py +++ b/dictionary/models.py @@ -406,6 +406,9 @@ class Frame(Model): positions_str_tab = [position['position'].text_rep for position in sorted_positions] return u'%s:%s' % (':'.join(frame_chars_str_tab), ' + '.join(positions_str_tab)) + def has_refl_args(self): + return self.positions.filter(arguments__type__in=['refl', 'recip']).exists() + def __unicode__(self): return '%s' % (self.text_rep) diff --git a/dictionary/teixml.py b/dictionary/teixml.py index b51d96d..c91fa35 100644 --- a/dictionary/teixml.py +++ b/dictionary/teixml.py @@ -43,7 +43,7 @@ def createteixml(outpath, lemmas, frame_char_models, form_dict, q_frame_opinions): root = write_root() write_header(root) - lemmas = lemmas.filter(entry=u'administrować') + #lemmas = lemmas.filter(entry=u'administrować') write_entries(root, lemmas, frame_char_models, form_dict, q_frame_opinions) with codecs.open(outpath, 'wt', 'utf-8') as output_file: diff --git a/semantics/validation.py b/semantics/validation.py index 366ecdc..77b49d1 100644 --- a/semantics/validation.py +++ b/semantics/validation.py @@ -94,9 +94,13 @@ def schemas_reflex_agreed(frame): for compl in complements: for real in compl.realizations.all(): schema_reflex = real.frame.get_char_value('ZWROTNOŚĆ').value - if not reflex_in_lexical_units(lexical_units, schema_reflex): + if (not reflex_in_lexical_units(lexical_units, schema_reflex)): return False return True + +#def refl_like_phrase_type_pinned(compl, real): +# same_frame_realizations = compl.realizations.filter(frame=real.frame, +# alternation=real.alternation) def reflex_in_lexical_units(lexical_units, reflex): for lex_unit in lexical_units: -- libgit2 0.22.2