Commit d272766c770949e13eea557f89ba236f792ab4ad
1 parent
de6ccfa7
zmiany związane z formatem wytjścia morfeusz.analyse
Showing
3 changed files
with
7 additions
and
10 deletions
dictionary/ajax_argument_form.py
... | ... | @@ -467,7 +467,7 @@ def get_parameter_types_to_exclude(arg_model): |
467 | 467 | def is_correct_lemma(argument_model, attribute_model, lemma): |
468 | 468 | correct_form = False |
469 | 469 | possible_pos_tags = argument_model.get_possible_lemma_tags(attribute_model) |
470 | - for interp in MORFEUSZ2.analyse(lemma): | |
470 | + for (_, _, interp) in MORFEUSZ2.analyse(lemma): | |
471 | 471 | if (base_form_correct(interp, lemma) and |
472 | 472 | pos_tag_correct(interp, possible_pos_tags)): |
473 | 473 | correct_form = True |
... | ... | @@ -498,8 +498,7 @@ def contains_separator(lemma): |
498 | 498 | if len(lemma.split()) > 1: |
499 | 499 | contains_separator = True |
500 | 500 | else: |
501 | - interps = MORFEUSZ2.analyse(lemma) | |
502 | - for (orth, base, tag, _, _) in interps: | |
501 | + for (_, _, (orth, base, tag, _, _)) in MORFEUSZ2.analyse(lemma): | |
503 | 502 | pos_tag = tag.split(':')[0] |
504 | 503 | if pos_tag == 'interp': |
505 | 504 | contains_separator = True |
... | ... | @@ -517,7 +516,7 @@ def is_preposition_case_pair_valid(preposition_obj, case_obj): |
517 | 516 | else: |
518 | 517 | pcase = [case_str] |
519 | 518 | for case in pcase: |
520 | - for (orth, base, tag, _, _) in MORFEUSZ2.analyse(prep_str): | |
519 | + for (_, _, (orth, base, tag, _, _)) in MORFEUSZ2.analyse(prep_str): | |
521 | 520 | tag_parts = tag.split(':') |
522 | 521 | if len(tag_parts) > 1: |
523 | 522 | interp_pos = tag_parts[0] |
... | ... |
dictionary/validation.py
... | ... | @@ -27,9 +27,8 @@ def check_aspect(lemma, frame): |
27 | 27 | inf_present = False |
28 | 28 | frame_aspect_obj = frame.characteristics.get(type=u'ASPEKT') |
29 | 29 | frame_aspect = frame_aspect_obj.value.value |
30 | - interps = MORFEUSZ2.analyse(lemma.entry) | |
31 | 30 | if frame_aspect != '_': |
32 | - for (orth, base, tag, _, _) in interps: | |
31 | + for (_, _, (orth, base, tag, _, _)) in MORFEUSZ2.analyse(lemma.entry): | |
33 | 32 | tag_parts = tag.split(':') |
34 | 33 | pos = tag_parts[0] |
35 | 34 | if pos == 'inf': |
... | ... | @@ -63,8 +62,7 @@ def get_missing_aspects_msg(lemma): |
63 | 62 | |
64 | 63 | def get_possible_aspects(lemma): |
65 | 64 | possible_aspects = [] |
66 | - interps = MORFEUSZ2.analyse(lemma.entry) | |
67 | - for (orth, base, tag, _, _) in interps: | |
65 | + for (_, _, (orth, base, tag, _, _)) in MORFEUSZ2.analyse(lemma.entry): | |
68 | 66 | tag_parts = tag.split(':') |
69 | 67 | pos = tag_parts[0] |
70 | 68 | if pos == 'inf': |
... | ... | @@ -357,7 +355,7 @@ def prep_check(arg): |
357 | 355 | else: |
358 | 356 | pcase = [pcase] |
359 | 357 | for case in pcase: |
360 | - for (orth, base, tag, _, _) in MORFEUSZ2.analyse(pform): | |
358 | + for (_, _, (orth, base, tag, _, _)) in MORFEUSZ2.analyse(pform): | |
361 | 359 | tag_parts = tag.split(':') |
362 | 360 | pos = tag_parts[0] |
363 | 361 | if pos == 'prep' and case in tag_parts[1].split('.'): |
... | ... |
wordnet/models.py
... | ... | @@ -62,7 +62,7 @@ class LexicalUnit(models.Model): |
62 | 62 | reflexive = True |
63 | 63 | elif last_is_lemma: |
64 | 64 | break |
65 | - for (orth, base, tag, _, _) in MORFEUSZ2.analyse(part): | |
65 | + for (_, _, (orth, base, tag, _, _)) in MORFEUSZ2.analyse(part): | |
66 | 66 | lemma = base.split(':')[0] |
67 | 67 | if lemma == self.entry.name: |
68 | 68 | last_is_lemma = True |
... | ... |