diff --git a/package.json b/package.json index b188b4e..da5cc78 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lingdocs/pashto-inflector", - "version": "1.2.3", + "version": "1.2.4", "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", diff --git a/src/lib/pashto-inflector.ts b/src/lib/pashto-inflector.ts index 0d5c365..a32a6d2 100644 --- a/src/lib/pashto-inflector.ts +++ b/src/lib/pashto-inflector.ts @@ -92,6 +92,7 @@ function handleUnisexWord(word: T.DictionaryEntryNoFVars): T.InflectorOutput { pashtoConsonants.includes(pEnd) || word.p.slice(-2) === "وی" || word.p.slice(-2) === "ای" || + word.f.slice(-1) === "w" || (word.p.slice(-1) === "ه" && word.f.slice(-1) === "h") ) { return { inflections: inflectConsonantEndingUnisex(word.p, word.f), ...plurals }; @@ -150,7 +151,8 @@ function handleFemNoun(word: T.DictionaryEntryNoFVars): T.InflectorOutput { if (word.p.slice(-1) === "ح" && endingInSingleARegex.test(word.f)) { return { inflections: inflectRegularAWithHimPEnding(word.p, word.f), ...plurals }; } - if (pashtoConsonants.includes(pEnd) && !animate) { + // TODO: better reusable function to check if something ends with a consonant + if ((pashtoConsonants.includes(pEnd) || word.f.slice(-1) === "w") && !animate) { return { inflections: inflectRegularInanMissingAFem(word.p, word.f), ...plurals }; } if (pEnd === "ي" && (!animate)) { diff --git a/src/lib/verb-conjugation.ts b/src/lib/verb-conjugation.ts index a795b25..4cb269d 100644 --- a/src/lib/verb-conjugation.ts +++ b/src/lib/verb-conjugation.ts @@ -622,7 +622,7 @@ function ensureShort3rdPersMascSing( const form = info.idiosyncraticThirdMascSing[aspect]; // if it ends in a consonant, the special form will also have another // variation ending with a ه - u - const endsInAConsonant = pashtoConsonants.includes(form.p.slice(-1)); + const endsInAConsonant = (pashtoConsonants.includes(form.p.slice(-1)) || form.f.slice(-1) === "w"); const replacement: T.ArrayOneOrMore = endsInAConsonant ? [form, concatPsString(form, { p: "ه", f: "u" })] : [form];