allow variations in pashto plural

This commit is contained in:
lingdocs 2021-09-16 16:41:50 -04:00
parent 30f6cad275
commit da12c7f62b
3 changed files with 27 additions and 3 deletions

View File

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

View File

@ -984,6 +984,25 @@ const nouns: Array<{
},
},
},
// with variations on Pashto plural
{
in: {"ts":1527815268,"i":8475,"p":"شی","f":"shey","g":"shey","ppp":"شیان، شیونه", "ppf": "sheyáan, sheyóona","e":"thing","c":"n. m."},
out: {
inflections: {
masc: [
[{ p: "شی", f: "shey" }],
[{ p: "شي", f: "shee" }],
[{ p: "شیو", f: "shiyo" }, { p: "شو", f: "sho" }],
],
},
plural: {
masc: [
[{ p: "شیان", f: "sheyáan" }, { p: "شیونه", f: "sheyóona" }],
[{ p: "شیانو", f: "sheyáano" }, { p: "شیونو", f: "sheyóono" }],
],
},
},
},
// TODO: Plaar plaroona paaraan - wrooNa
// Word with no inflections
{

View File

@ -373,9 +373,14 @@ function inflectRegularUyFem(p: string, f: string): T.Inflections {
function makePashtoPlural(word: T.DictionaryEntryNoFVars): T.PluralInflections | undefined {
if (!(word.ppp && word.ppf)) return undefined;
const base = makePsString(word.ppp, word.ppf);
const base = splitPsByVarients(
makePsString(word.ppp, word.ppf)
);
function getBaseAndO(): T.PluralInflectionSet {
return [[base], addOEnding(base)];
return [
base,
base.flatMap(addOEnding) as T.ArrayOneOrMore<T.PsString>,
];
}
if (word.c?.includes("n. m.")) {
return { masc: getBaseAndO() };