This commit is contained in:
lingdocs 2022-05-07 00:52:56 -05:00
parent 7bb5f46bb9
commit 7db00e2ac2
4 changed files with 10 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@lingdocs/pashto-inflector",
"version": "2.4.6",
"version": "2.4.7",
"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

@ -164,6 +164,7 @@ export function randFromArray<M>(arr: M[]): M {
export const isFirstPerson = (p: T.Person) => [0, 1, 6, 7].includes(p);
export const isSecondPerson = (p: T.Person) => [2, 3, 8, 9].includes(p);
export const isThirdPerson = (p: T.Person) => [4, 5, 10, 11].includes(p);
export function incrementPerson(p: T.Person): T.Person {
return (p + 1) % 12;

View File

@ -95,7 +95,8 @@ function addArticlesAndAdjs(np: T.Rendered<T.NounSelection>): string | undefined
if (!curr.e) throw new Error("no english for adjective");
return accum + curr.e + " ";
}, "");
return `${articles}${adjs}${word}`;
const genderTag = np.genderCanChange ? (np.gender === "fem" ? " (f.)" : " (m.)") : "";
return `${articles}${adjs}${word}${genderTag}`;
} catch (e) {
return undefined;
}

View File

@ -98,6 +98,9 @@ import {
personNumber,
randFromArray,
chooseLength,
isFirstPerson,
isSecondPerson,
isThirdPerson,
} from "./lib/misc-helpers";
import {
flattenLengths,
@ -199,6 +202,9 @@ export {
compileVP,
chooseLength,
flattenLengths,
isFirstPerson,
isSecondPerson,
isThirdPerson,
// protobuf helpers
readDictionary,
writeDictionary,