Skip to content

Commit

Permalink
fix male plural issue, should been just ماماګان not ماماین
Browse files Browse the repository at this point in the history
  • Loading branch information
adueck committed Jun 24, 2024
1 parent b9cdc63 commit 1a0e192
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 16 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pashto-inflector",
"version": "7.1.3",
"version": "7.1.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",
Expand Down
4 changes: 2 additions & 2 deletions src/components/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lingdocs/ps-react",
"version": "7.1.3",
"version": "7.1.4",
"description": "Pashto inflector library module with React components",
"main": "dist/components/library.js",
"module": "dist/components/library.js",
Expand Down
2 changes: 1 addition & 1 deletion src/lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lingdocs/inflect",
"version": "7.1.3",
"version": "7.1.4",
"description": "Pashto inflector library",
"main": "dist/index.js",
"types": "dist/lib/library.d.ts",
Expand Down
37 changes: 30 additions & 7 deletions src/lib/src/pashto-inflector.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -850,28 +850,51 @@ const nouns: {
},
},
},
// masculine ending in a vowel
// masculine ending in a vowe
{
in: {
ts: 1527816446,
i: 12568,
p: "کاکا",
f: "kaakáa",
g: "kaakaa",
e: "paternal uncle, term of address for elderly man",
r: 4,
c: "n. m. anim.",
a: 1,
},
out: {
plural: {
masc: [
[{ p: "کاکاګان", f: "kaakaagáan" }],
[{ p: "کاکاګانو", f: "kaakaagáano" }],
],
},
},
},
{
in: {
ts: 1527815484,
i: 13069,
p: "ملا",
f: "mUllaa",
g: "mUllaa",
f: "mUláa",
g: "mUláa",
e: "mullah, priest",
ppp: "ملایان",
ppf: "mUlaayáan",
r: 4,
c: "n. m.",
},
out: {
plural: {
masc: [
[
{ p: "ملایان", f: "mUllaayáan" },
{ p: "ملاګان", f: "mUllaagáan" },
{ p: "ملایان", f: "mUlaayáan" },
{ p: "ملاګان", f: "mUlaagáan" },
],
[
{ p: "ملایانو", f: "mUllaayáano" },
{ p: "ملاګانو", f: "mUllaagáano" },
{ p: "ملایانو", f: "mUlaayáano" },
{ p: "ملاګانو", f: "mUlaagáano" },
],
],
},
Expand Down
23 changes: 21 additions & 2 deletions src/lib/src/pashto-inflector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,23 @@ function makePlural(
if (w.c.includes("n. m.")) return { plural: { masc: plural } };
if (w.c.includes("n. f.")) return { plural: { fem: plural } };
}
// exception for mUláa
if (w.f === "mUláa" || w.f === "mUlaa") {
return {
plural: {
masc: [
[
{ p: "ملایان", f: "mUlaayáan" },
{ p: "ملاګان", f: "mUlaagáan" },
],
[
{ p: "ملایانو", f: "mUlaayáano" },
{ p: "ملاګانو", f: "mUlaagáano" },
],
],
},
};
}
const arabicPlural = makeArabicPlural(w);
const pashtoPlural = makePashtoPlural(w);
const bundledPlural = makeBundledPlural(w);
Expand Down Expand Up @@ -619,6 +636,8 @@ function makePlural(
};
}
function addLongVowelSuffix(gender: "masc" | "fem"): T.PluralInflectionSet {
if (pashtoPlural) {
}
const base = removeEndTick(makePsString(w.p, w.f));
const baseWOutAccents = removeAccents(base);
const space =
Expand All @@ -630,7 +649,6 @@ function makePlural(
]);
} else {
return addSecondInf([
concatPsString(baseWOutAccents, space, { p: "یان", f: "yáan" }),
concatPsString(baseWOutAccents, space, { p: "ګان", f: "gáan" }),
]);
}
Expand Down Expand Up @@ -663,11 +681,12 @@ function makePlural(
: w.c?.includes("n. f.")
? "fem noun"
: "other";
if (pashtoPlural)
if (pashtoPlural) {
return {
plural: pashtoPlural,
arabicPlural,
};
}
if (type === "unisex noun") {
// doesn't need to be labelled anim - because it's only with animate nouns that you get the unisex - I THINK
if (endsInConsonant(w) && !w.infap) {
Expand Down

0 comments on commit 1a0e192

Please sign in to comment.