-
-
- pronouns.introquotation.colon
+
+
+
+ pronouns.introquotation.colon
+
+ comprehensive = updated"/>
@@ -76,6 +79,8 @@
examples,
groupKey,
pronounGroups,
+
+ comprehensive: false,
}
},
head() {
@@ -98,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];
},
}
}
diff --git a/routes/pronoun.vue b/routes/pronoun.vue
index 9fc88621e..aba9a7fde 100644
--- a/routes/pronoun.vue
+++ b/routes/pronoun.vue
@@ -7,10 +7,7 @@
pronouns.introquotation.colon
-
-
-
-
+
comprehensive = updated"/>
@@ -130,6 +127,8 @@
nameOptions: selectedPronoun ? selectedPronoun.nameOptions() : [],
pronounGroup: pronounLibrary.find(selectedPronoun),
+ comprehensive: false,
+
counter: 0,
counterHandle: null,
counterSpeed: 1000,
@@ -195,24 +194,6 @@
},
},
computed: {
- comprehensive: {
- get() {
- return this.$route.query.hasOwnProperty(this.config.pronouns.comprehensive);
- },
- set(value) {
- if (value == this.comprehensive) {
- // prevent warning that $router.replace has no effect
- return;
- }
- let query = Object.assign({}, this.$route.query);
- if (value) {
- query[this.config.pronouns.comprehensive] = null;
- } else {
- delete query[this.config.pronouns.comprehensive];
- }
- this.$router.replace({ query })
- }
- },
sourceLibrary() {
return new SourceLibrary(this.sources);
},