Skip to content

Commit

Permalink
minor update for token search dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
khansadaoudi committed Oct 24, 2024
1 parent 4d201b2 commit ede41f5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
16 changes: 9 additions & 7 deletions src/components/sentence/TokensReplaceDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,11 @@
</q-bar>
<q-card-section>
<div class="q-gutter-md">
<q-input v-model="selectedToken" filled :label="$t('tokenReplaceDialog.multiWord')" />
<q-input v-model="firstToken" filled :label="$t('tokenReplaceDialog.firstToken')" />
<q-input v-model="secondToken" filled :label="$t('tokenReplaceDialog.secondToken')" />
<q-checkbox v-model="multiword" :label="$t('tokenReplaceDialog.multiWordToken')"></q-checkbox>
<q-input dense outlined readonly v-model="selectedToken" :label="$t('tokenReplaceDialog.selectedToken')" />
<q-input dense outlined v-model="firstToken" :label="$t('tokenReplaceDialog.firstToken')" />
<q-input dense outlined v-model="secondToken" :label="$t('tokenReplaceDialog.secondToken')" />
<q-checkbox v-model="isMultiword" :label="$t('tokenReplaceDialog.multiWordToken')"></q-checkbox>
<q-input dense outlined v-if="isMultiword" v-model="multiWordToken" :label="$t('tokenReplaceDialog.multiWord')" />
<div class="row q-gutter-md justify-center">
<q-btn :disable="!firstToken && !secondToken" v-close-popup label="Split" color="primary" @click="tokenReplaceOptions('split')" />
</div>
Expand Down Expand Up @@ -126,9 +127,10 @@ export default defineComponent({
tokensIndexes,
isShowFusion: false,
selectedToken: this.token.FORM,
multiWordToken: this.token.FORM,
secondToken: '',
firstToken: '',
multiword: false,
isMultiword: false,
};
},
computed: {
Expand Down Expand Up @@ -168,12 +170,12 @@ export default defineComponent({
const tokensIndexes = this.tokensIndexes;
const newTokensForm = this.tokensForms;
const newTree = replaceArrayOfTokens(oldTree, tokensIndexes, newTokensForm, true);
if (this.multiword) {
if (this.isMultiword) {
const newGroupJson = {
DEPREL: '_',
DEPS: {},
FEATS: {},
FORM: this.selectedToken,
FORM: this.multiWordToken,
HEAD: -1,
ID: String(tokensIndexes[0]) + '-' + String(tokensIndexes[0] + 1),
LEMMA: '_',
Expand Down
3 changes: 2 additions & 1 deletion src/i18n/en-us/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,9 +432,10 @@ export default {
insertOptions: ['Insert before', 'Insert after'],
split: 'Split token',
delete: 'Delete token',
multiWord: 'Multiword',
multiWord: 'Multiword token',
firstToken: 'First token',
secondToken: 'Second token',
selectedToken: 'Selected token',
multiWordToken: 'Add multiword token',
},
multiEditDialog: {
Expand Down
3 changes: 2 additions & 1 deletion src/i18n/fr-fra/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -435,9 +435,10 @@ export default {
insertOptions: ['Insérer avant', 'Insérer après'],
split: 'diviser token',
delete: 'Supprimer token',
multiWord: 'Multiword',
multiWord: 'Multiword token',
firstToken: 'Premier token',
secondToken: 'Deuxième token',
selectedToken: 'Token sélectionné',
multiWordToken: 'Ajouter multiword token',
},
multiEditDialog: {
Expand Down

0 comments on commit ede41f5

Please sign in to comment.