From 9f8c636b2badedda6f1492f0dbb8a0cebd396434 Mon Sep 17 00:00:00 2001 From: dcz <dcz@ipipan.waw.pl> Date: Fri, 17 Nov 2023 11:41:15 +0100 Subject: [PATCH] Ommit a lemma argument on the attach lus. Schema show bugfix (no connection to argument). --- .../SemanticsSchemataComponent.vue | 8 +++-- unifier/views.py | 29 +++++++++++-------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/frontend/src/components/unification/shared/frame-components/SemanticsSchemataComponent.vue b/frontend/src/components/unification/shared/frame-components/SemanticsSchemataComponent.vue index fef1136..d54bb79 100644 --- a/frontend/src/components/unification/shared/frame-components/SemanticsSchemataComponent.vue +++ b/frontend/src/components/unification/shared/frame-components/SemanticsSchemataComponent.vue @@ -57,8 +57,10 @@ argumentIdSet.forEach(argumentId => { const argument = this.frame.arguments.find(arg => argumentId.endsWith(arg.argument_id)); - const role = argument.role; - styles.push(role); + if(argument) { + const role = argument.role; + styles.push(role); + } }); } @@ -116,7 +118,7 @@ <div class="mb-1 sticky-top"><h5 class="bg-dark text-light p-1">{{subentry.str}}</h5></div> <template v-for="schema in subentry.schemata"> <div class="schema mb-3" - v-if="this.frame && alternations[this.frame.id][schema.id]" + v-if="this.frame && alternations[this.frame.id] && alternations[this.frame.id][schema.id]" @mouseenter="schema.hover=true" @mouseleave="schema.hover=false" @click="selectSchema(schema)" diff --git a/unifier/views.py b/unifier/views.py index 307eb20..06fba97 100644 --- a/unifier/views.py +++ b/unifier/views.py @@ -1106,19 +1106,24 @@ def attach_lu_to_unified_frame(request): slowal_frame_arguments = list(frame.arguments.all()) unified_frame_arguments = list(unified_frame.unified_arguments.all()) slowal_frame_argument_cnt = len(slowal_frame_arguments) + col_cnt = 0 for ind in range(slowal_frame_argument_cnt): - if ind >= len(unified_frame_arguments): - # create additional argument in unified frame - unified_frame_argument = UnifiedFrameArgument(unified_frame=unified_frame) - UnifiedFrameArgument.save(unified_frame_argument) - else: - unified_frame_argument = unified_frame_arguments[ind] - - unified_frame_argument_slowal_frame_mapping = \ - UnifiedFrameArgumentSlowalFrameMapping(unified_frame_mapping=mapping, - unified_agrument=unified_frame_argument, - slowal_agrument=slowal_frame_arguments[ind]) - UnifiedFrameArgumentSlowalFrameMapping.save(unified_frame_argument_slowal_frame_mapping) + slowal_agrument = slowal_frame_arguments[ind] + if slowal_agrument.role.role.role != 'Lemma': + if col_cnt >= len(unified_frame_arguments): + # create additional argument in unified frame + unified_frame_argument = UnifiedFrameArgument(unified_frame=unified_frame) + UnifiedFrameArgument.save(unified_frame_argument) + else: + unified_frame_argument = unified_frame_arguments[col_cnt] + + unified_frame_argument_slowal_frame_mapping = \ + UnifiedFrameArgumentSlowalFrameMapping(unified_frame_mapping=mapping, + unified_agrument=unified_frame_argument, + slowal_agrument=slowal_agrument) + UnifiedFrameArgumentSlowalFrameMapping.save(unified_frame_argument_slowal_frame_mapping) + + col_cnt = col_cnt + 1 for frame in frames: http = urllib3.PoolManager() -- GitLab