mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-24 05:05:20 -04:00
(pronouns) interpret empty morpheme as missing morpheme in interchangeable pronouns
This commit is contained in:
parent
b8a40b16df
commit
ed4049b3cc
@ -46,7 +46,7 @@ export class Example {
|
|||||||
|
|
||||||
requiredMorphemesPresent(pronoun, counter = 0) {
|
requiredMorphemesPresent(pronoun, counter = 0) {
|
||||||
return this.parts(pronoun, counter).filter(part => part.variable)
|
return this.parts(pronoun, counter).filter(part => part.variable)
|
||||||
.every(part => pronoun.getMorpheme(part.str, counter) != null);
|
.every(part => pronoun.getMorpheme(part.str, counter) !== null);
|
||||||
}
|
}
|
||||||
|
|
||||||
format(pronoun) {
|
format(pronoun) {
|
||||||
@ -400,6 +400,9 @@ export class Pronoun {
|
|||||||
const options = this.morphemes[morpheme].split('&');
|
const options = this.morphemes[morpheme].split('&');
|
||||||
|
|
||||||
const result = options[counter % options.length];
|
const result = options[counter % options.length];
|
||||||
|
if (result === '') {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return capital ? capitalise(result) : result;
|
return capital ? capitalise(result) : result;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user