diff --git a/src/lib/pashto-inflector.test.ts b/src/lib/pashto-inflector.test.ts index 7ff68cf..1b5d2f7 100644 --- a/src/lib/pashto-inflector.test.ts +++ b/src/lib/pashto-inflector.test.ts @@ -499,6 +499,17 @@ const nouns: Array<{ }, }, }, + { + in: {"i":11352,"ts":1527813995,"p":"لو","f":"law, lau","g":"law,lau","e":"harvesting, reaping, hay-making; mowed, reaped, harvested","c":"n. m."}, + out: { + plural: { + masc: [ + [{ p: "لوونه", f: "lawóona" }], + [{ p: "لوونو", f: "lawóono" }], + ], + }, + }, + }, // ## FEMININE // Feminine regular ending in ه { @@ -713,6 +724,18 @@ const nouns: Array<{ }, }, }, + // Feminine regular ending in و + { + in: {"i":2899,"ts":1527815163,"p":"پیشو","f":"peeshó","g":"peesho","e":"cat","c":"n. f. anim."}, + out: { + plural: { + fem: [ + [{ p: "پیشووې", f: "peeshówe" }, { p: "پیشوګانې", f: "peeshogáane" }], + [{ p: "پیشووو", f: "peeshówo" }, { p: "پیشوګانو", f: "peeshogáano" }], + ], + }, + }, + }, // Feminine regular ending in اع { in: { @@ -734,6 +757,7 @@ const nouns: Array<{ // }, // }, }, + // TODO: Plaar plaroona paaraan - wrooNa // Word with no inflections { in: { diff --git a/src/lib/pashto-inflector.ts b/src/lib/pashto-inflector.ts index 189edbb..f9cea50 100644 --- a/src/lib/pashto-inflector.ts +++ b/src/lib/pashto-inflector.ts @@ -121,7 +121,6 @@ function handleMascNoun(w: T.DictionaryEntryNoFVars): T.InflectorOutput { function handleFemNoun(word: T.DictionaryEntryNoFVars): T.InflectorOutput { // Get first of comma seperated phonetics entries - const f = word.f.split(",")[0].trim(); /* istanbul ignore next */ // will always have word.c at this point const c = word.c || ""; const animate = c.includes("anim."); @@ -129,20 +128,20 @@ function handleFemNoun(word: T.DictionaryEntryNoFVars): T.InflectorOutput { const plural = makePlural(word); - if (endingInHeyOrAynRegex.test(word.p) && endingInSingleARegex.test(f)) { - return { inflections: inflectRegularAFem(word.p, f), plural }; + if (endingInHeyOrAynRegex.test(word.p) && endingInSingleARegex.test(word.f)) { + return { inflections: inflectRegularAFem(word.p, word.f), plural }; } - if (word.p.slice(-1) === "ح" && endingInSingleARegex.test(f)) { - return { inflections: inflectRegularAWithHimPEnding(word.p, f), plural }; + if (word.p.slice(-1) === "ح" && endingInSingleARegex.test(word.f)) { + return { inflections: inflectRegularAWithHimPEnding(word.p, word.f), plural }; } if (pashtoConsonants.includes(pEnd) && !animate) { - return { inflections: inflectRegularInanMissingAFem(word.p, f), plural }; + return { inflections: inflectRegularInanMissingAFem(word.p, word.f), plural }; } if (pEnd === "ي" && (!animate)) { - return { inflections: inflectRegularInanEeFem(word.p, f), plural }; + return { inflections: inflectRegularInanEeFem(word.p, word.f), plural }; } if (pEnd === "ۍ") { - return { inflections: inflectRegularUyFem(word.p, f), plural }; + return { inflections: inflectRegularUyFem(word.p, word.f), plural }; } // if (endingInAlefRegex.test(word.p)) { // return { inflections: inflectRegularAaFem(word.p, f) };