when inflecting words avoid the maashoomo problem

This commit is contained in:
lingdocs 2022-08-14 14:00:36 +04:30
parent 12d79b6311
commit 51f5920e2c
2 changed files with 9 additions and 6 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@lingdocs/pashto-inflector", "name": "@lingdocs/pashto-inflector",
"version": "3.7.2", "version": "3.7.3",
"author": "lingdocs.com", "author": "lingdocs.com",
"description": "A Pashto inflection and verb conjugation engine, inculding React components for displaying Pashto text, inflections, and conjugations", "description": "A Pashto inflection and verb conjugation engine, inculding React components for displaying Pashto text, inflections, and conjugations",
"homepage": "https://verbs.lingdocs.com", "homepage": "https://verbs.lingdocs.com",

View File

@ -52,11 +52,14 @@ export function renderNounSelection(n: T.NounSelection, inflected: boolean, role
const infs = inflectWord(n.entry); const infs = inflectWord(n.entry);
const ps = n.number === "singular" const ps = n.number === "singular"
? getInf(infs, "inflections", n.gender, false, inflected) ? getInf(infs, "inflections", n.gender, false, inflected)
: [ : (() => {
...getInf(infs, "plural", n.gender, true, inflected), const plural = getInf(infs, "plural", n.gender, true, inflected);
...getInf(infs, "arabicPlural", n.gender, true, inflected), return [
...getInf(infs, "inflections", n.gender, true, inflected), ...plural,
]; ...getInf(infs, "arabicPlural", n.gender, true, inflected),
...!plural.length ? getInf(infs, "inflections", n.gender, true, inflected) : [],
];
})();
return ps.length > 0 return ps.length > 0
? ps ? ps
: [psStringFromEntry(n.entry)]; : [psStringFromEntry(n.entry)];