mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-24 05:05:20 -04:00
(pronouns) in any pronouns, do not use a pronoun in a example sentence if it has not all required morphemes
This commit is contained in:
parent
773976f0b6
commit
41debf31a7
@ -35,7 +35,7 @@
|
||||
|
||||
<ul>
|
||||
<li v-for="example in examples" v-if="!example.comprehensive || comprehensive" class="my-1">
|
||||
<Example :example="example" :pronoun="randomPronoun()" link/>
|
||||
<Example :example="example" :pronoun="randomPronounForExample(example)" link/>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
@ -103,9 +103,10 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
randomPronoun() {
|
||||
const keys = Object.keys(this.pronounsChoice);
|
||||
return this.pronounsChoice[keys[keys.length * Math.random() << 0]];
|
||||
randomPronounForExample(example) {
|
||||
const suitablePronouns = Object.values(this.pronounsChoice)
|
||||
.filter(pronoun => example.requiredMorphemesPresent(pronoun));
|
||||
return suitablePronouns[suitablePronouns.length * Math.random() << 0];
|
||||
},
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user