Skip to content

Commit

Permalink
merge all metadata in sentence segmentation view
Browse files Browse the repository at this point in the history
  • Loading branch information
khansadaoudi committed Oct 21, 2024
1 parent 79ed5c8 commit fc2bf7c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/sentence/SentenceSegmentation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,12 @@
</VueDepTree>
</div>
<div class="q-gutter-md q-py-md">
<div class="row text-h6">
{{ $t('sentenceSegmentation.proposedMetadata') }}
</div>
<q-input
class="row"
v-for="meta in Object.keys(mergedReactiveSentence[userId].state.metaJson).filter((key) => key.includes('text'))"
v-for="meta in Object.keys(mergedReactiveSentence[userId].state.metaJson).filter((key) => !unchangedMetaData.includes(key))"
dense
outlined
v-model="mergedReactiveSentence[userId].state.metaJson[meta]"
Expand Down Expand Up @@ -319,6 +322,7 @@ export default defineComponent({
forceRender: 0,
mergedSentId: '',
mergeWarningMessage: '',
unchangedMetaData: ['sent_id', 'user_id', 'timestamp']
};
},
computed: {
Expand Down Expand Up @@ -487,7 +491,7 @@ export default defineComponent({
timestamp: firstSentenceJson.metaJson.timestamp > secondSentenceJson.metaJson.timestamp ? firstSentenceJson.metaJson.timestamp: secondSentenceJson.metaJson.timestamp,
sent_id: this.proposeMergedSentId(firstSentenceJson.metaJson.sent_id as string, secondSentenceJson.metaJson.sent_id as string),
};
for (const key of Object.keys(firstSentenceJson.metaJson).filter(key => key.includes('text'))) {
for (const key of Object.keys(firstSentenceJson.metaJson)) {
if (Object.keys(secondSentenceJson.metaJson).includes(key)) {
mergedSentence.metaJson[key] = `${firstSentenceJson.metaJson[key]} ${secondSentenceJson.metaJson[key]}`
}
Expand Down
1 change: 1 addition & 0 deletions src/i18n/en-us/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ export default {
'The sent_id is the same sent_id used in the first sentence',
],
selectMergeLabel: 'Select the sent_id of the phrase you wish to merge with the current phrase',
proposedMetadata: 'Proposed Metadata',
},
grewHistory: {
historyBtn: 'History',
Expand Down
1 change: 1 addition & 0 deletions src/i18n/fr-fra/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ export default {
"Le changement de tokens perturbe la comparabilité des différentes annotations d'une même phrase.",
'Remplacement',
],
proposedMetadata: 'Les métadonnées proposées',
},
constructicon: {
uploadBtn: 'Importer un constructicon',
Expand Down

0 comments on commit fc2bf7c

Please sign in to comment.