(pronouns) interpret empty morpheme as missing morpheme in interchangeable pronouns

This commit is contained in:
Valentyne Stigloher 2024-01-04 14:20:20 +01:00
parent b8a40b16df
commit ed4049b3cc

View File

@ -46,7 +46,7 @@ export class Example {
requiredMorphemesPresent(pronoun, counter = 0) {
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) {
@ -400,6 +400,9 @@ export class Pronoun {
const options = this.morphemes[morpheme].split('&');
const result = options[counter % options.length];
if (result === '') {
return null;
}
return capital ? capitalise(result) : result;
}