diff --git a/frontend/src/components/unification/shared/frame-components/SemanticsSchemataComponent.vue b/frontend/src/components/unification/shared/frame-components/SemanticsSchemataComponent.vue index fef1136536a17280a7f98a48bace236ca774f4a7..d54bb792b5a42815bc0bd2041b812ddf0afdff7a 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 307eb2027bcc376822f78c3f6d554e14285b7c45..06fba97ab97b75aa478885e6de076fc85c8248d6 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()