(pronouns) add option to mark examples as comprehensive

This commit is contained in:
Valentyne Stigloher 2023-11-04 09:05:40 +01:00
parent d19fe78909
commit 8fc3dca3fb
5 changed files with 14 additions and 12 deletions

View File

@ -1,9 +1,9 @@
singular plural isHonorific
{'pronoun_n} ist so süß. {pronoun_n} sind so süß. FALSE
Ist das {possessive_m_n} Hund? FALSE
Heute hat {pronoun_n} {possessive_m_a} Apfel, {possessive_f_a} Birne und {possessive_n_a} Törtchen dabei. Heute haben {pronoun_n} {possessive_m_a} Apfel, {possessive_f_a} Birne und {possessive_n_a} Törtchen dabei. FALSE
{'possessive_n_n} Kaninchen spielt mit {possessive_m_d} Hund. FALSE
Meine Lieblingsfarbe ist violett, {possessive_f_n} ist gelb. FALSE
Wir freuen uns {pronoun_g}. FALSE
Ich bin {pronoun_d} erst kürzlich begegnet. FALSE
Ich verstehe {pronoun_a} so gut. FALSE
singular plural isHonorific comprehensive
{'pronoun_n} ist so süß. {pronoun_n} sind so süß. FALSE FALSE
Ist das {possessive_m_n} Hund? FALSE FALSE
Heute hat {pronoun_n} {possessive_m_a} Apfel, {possessive_f_a} Birne und {possessive_n_a} Törtchen dabei. Heute haben {pronoun_n} {possessive_m_a} Apfel, {possessive_f_a} Birne und {possessive_n_a} Törtchen dabei. FALSE TRUE
{'possessive_n_n} Kaninchen spielt mit {possessive_m_d} Hund. FALSE TRUE
Meine Lieblingsfarbe ist violett, {possessive_f_n} ist gelb. FALSE TRUE
Wir freuen uns {pronoun_g}. FALSE TRUE
Ich bin {pronoun_d} erst kürzlich begegnet. FALSE FALSE
Ich verstehe {pronoun_a} so gut. FALSE FALSE

1 singular plural isHonorific comprehensive
2 {'pronoun_n} ist so süß. {pronoun_n} sind so süß. FALSE FALSE
3 Ist das {possessive_m_n} Hund? FALSE FALSE
4 Heute hat {pronoun_n} {possessive_m_a} Apfel, {possessive_f_a} Birne und {possessive_n_a} Törtchen dabei. Heute haben {pronoun_n} {possessive_m_a} Apfel, {possessive_f_a} Birne und {possessive_n_a} Törtchen dabei. FALSE TRUE
5 {'possessive_n_n} Kaninchen spielt mit {possessive_m_d} Hund. FALSE TRUE
6 Meine Lieblingsfarbe ist violett, {possessive_f_n} ist gelb. FALSE TRUE
7 Wir freuen uns {pronoun_g}. FALSE TRUE
8 Ich bin {pronoun_d} erst kürzlich begegnet. FALSE FALSE
9 Ich verstehe {pronoun_a} so gut. FALSE FALSE

View File

@ -52,7 +52,7 @@
</h2>
<ul>
<li v-for="example in examples" v-if="example.requiredMorphemesPresent(selectedPronoun, counter)" class="my-1">
<li v-for="example in examples" v-if="example.requiredMorphemesPresent(selectedPronoun, counter) && (!example.comprehensive || comprehensive)" class="my-1">
<Example :example="example" :pronoun="selectedPronoun" :counter="counter" pronunciation/>
</li>
</ul>

View File

@ -84,7 +84,7 @@
</p>
<template v-for="isHonorific in [false, true]" v-if="examples.filter(e => e.isHonorific === isHonorific).length">
<ul>
<li v-for="example in examples" v-if="example.isHonorific === isHonorific">
<li v-for="example in examples" v-if="example.isHonorific === isHonorific && !example.comprehensive">
<span v-for="part in clearExampleParts(example.parts(selectedPronoun))">
<input v-if="part.variable" v-model="selectedPronoun.morphemes[part.str]"
:class="['form-control form-input p-0', {'active': selectedMorpheme === part.str}]"

View File

@ -11,10 +11,11 @@ export class ExamplePart {
}
export class Example {
constructor(singularParts, pluralParts, isHonorific = false) {
constructor(singularParts, pluralParts, isHonorific = false, comprehensive = false) {
this.singularParts = singularParts;
this.pluralParts = pluralParts;
this.isHonorific = isHonorific;
this.comprehensive = comprehensive;
}
static parse(str) {

View File

@ -12,6 +12,7 @@ export const examples = buildList(function* () {
Example.parse(e.singular),
Example.parse(e.plural || e.singular),
e.isHonorific,
e.comprehensive || false,
);
}
});