From 3f04c97c4186b23d31a3c1c5c5940b66141e1926 Mon Sep 17 00:00:00 2001 From: Tomasz Bartosiak <tomasz.bartosiak@gmail.com> Date: Fri, 3 Nov 2023 15:33:52 +0100 Subject: [PATCH] Finished prunning connections between frames and schemata --- common/management/commands/valunifier_tei.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/common/management/commands/valunifier_tei.py b/common/management/commands/valunifier_tei.py index 9a0c56f..b4ecf8b 100644 --- a/common/management/commands/valunifier_tei.py +++ b/common/management/commands/valunifier_tei.py @@ -387,8 +387,17 @@ def valid_connection(lexical_unit, schema_hook, connections_info): if schema_id in lu_schema_connections[lexical_unit]: return True if connected_lu_count[schema_id] == 0: - # @TODO: check for "siÄ™" - return True + in_lemma = False + in_lemma |= (' siÄ™ ' in lexical_unit.base) + in_lemma |= (lexical_unit.base.endswith(' siÄ™')) + in_schema = False + in_schema |= (schema_hook.subentry.inherent_sie.name == 'true') + for position in schema_hook.schema.positions.all(): + if position.phrases_count == 1: + phrase_type = position.phrase_types.all()[0].main_type + in_schema |= (phrase_type == 'refl') + in_schema |= (phrase_type == 'recip') + return (in_lemma == in_schema) return False def write_phrases_coll(parent, phrases_list): -- GitLab