From 564f5bd54246a538cae3213e07de35e50cac9052 Mon Sep 17 00:00:00 2001 From: Kasia Krasnowska <kasia.krasnowska@gmail.com> Date: Mon, 5 Jul 2021 11:29:01 +0200 Subject: [PATCH] phrase/realisation descriptions fixes/updates --- entries/phrase_descriptions/descriptions.py | 14 +++++++++++--- importer/RealizationDescriptions.py | 11 +++++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/entries/phrase_descriptions/descriptions.py b/entries/phrase_descriptions/descriptions.py index 5f4bffd..8c37a91 100644 --- a/entries/phrase_descriptions/descriptions.py +++ b/entries/phrase_descriptions/descriptions.py @@ -343,6 +343,13 @@ def make_phraseologisms(phrase, function, negativity, attrs={}, controller=None, feats = ['adj', attrs['num'], attrs['case'], attrs['gend'], 'pos'] return ['‹{}›'.format(get_form('jakiś', feats)[0])] if ptype in (LexAdjP, LexPPasP, LexPActP): + print('****************', phrase, controller, controller_grammar) + # np. uczynić coś *jakimś* / kobietę *jakąś* + # w składni nie będzie controller_grammar + #TODO test? (***) + if not function and controller and controller_grammar: + function = controller._function._value if controller._function else None + control = True if ptype == LexAdjP: phrase2 = phrase._adjp POS = lambda lemma: correct_pos(lemma, 'adj') @@ -363,9 +370,10 @@ def make_phraseologisms(phrase, function, negativity, attrs={}, controller=None, CASE = correct_case(phrase2._case._value, function, negativity) # np. uczynić coś *jakimś* / kobietę *jakąś* # w składni nie będzie controller_grammar - if controller and controller_grammar: - function = controller._function._value if controller._function else None - control = True + #TODO test? (***) + #if controller and controller_grammar: + # function = controller._function._value if controller._function else None + # control = True if phrase._number == 'agr' and 'num' in attrs: num = attrs['num'] assert (num != 'agr') diff --git a/importer/RealizationDescriptions.py b/importer/RealizationDescriptions.py index 8bea9bb..e24559e 100644 --- a/importer/RealizationDescriptions.py +++ b/importer/RealizationDescriptions.py @@ -469,6 +469,11 @@ def generate_phrases(function, negativity, phrase, lemma, is_predef, head_gender phrase_type = phrase._name dummy_id = None + # jak dotąd tylko jeden przypadek zagnieżdżonej frazy lex: + # zależeć: _: : imperf: subj{np(str);ncp(str,int)} + {prepnp(od,gen);prepncp(od,gen,int)} + {xp(mod[comprepnp(na sposób);advp(mod);lex(prepnp(w,acc),sg,'sposób',atr({adjp(agr)}))])} + if isinstance(phrase, LexPhrase): + return make_phraseologisms(phrase, function, negativity, controller=controller, controller_grammar=controller_grammar), None, None + if is_predef and phrase_type == 'xp' and not phrase._category._limitations: advcat = phrase._category._value # np. „komuś podobało się gdzieś†@@ -1008,6 +1013,12 @@ FALLBACK = { 'do zbiornika' : 2, 'samo' : 1, 'do (‹jakiejś›) ręki / do (‹jakichś›) rąk' : 2, + 'sama' : 1, + 'w (moje/pańskie/Anny/…) (‹jakieś›) ręce' : 2, + 'sam' : 1, + 'przed (moje/pańskie/Anny/…) (‹jakieś›) oczy' : 2, + 'sama' : 1, + 'do (mojej/pańskiej/Anny/…) (‹jakiejś›) ręki / do (moich/pańskich/Anny/…) (‹jakichś›) rąk' : 2, } def fallback(description): -- GitLab