From 1a0e1922d8869fb859933ee347fbd471fc56d0f1 Mon Sep 17 00:00:00 2001 From: adueck Date: Mon, 24 Jun 2024 16:10:02 -0400 Subject: [PATCH] =?UTF-8?q?fix=20male=20plural=20issue,=20should=20been=20?= =?UTF-8?q?just=20=D9=85=D8=A7=D9=85=D8=A7=DA=AB=D8=A7=D9=86=20not=20?= =?UTF-8?q?=D9=85=D8=A7=D9=85=D8=A7=DB=8C=D9=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 4 +-- package.json | 2 +- src/components/package-lock.json | 4 +-- src/components/package.json | 2 +- src/lib/package.json | 2 +- src/lib/src/pashto-inflector.test.ts | 37 ++++++++++++++++++++++------ src/lib/src/pashto-inflector.ts | 23 +++++++++++++++-- 7 files changed, 58 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7049db3..d1a174e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "pashto-inflector", - "version": "7.1.3", + "version": "7.1.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "pashto-inflector", - "version": "7.1.3", + "version": "7.1.4", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 5fd3601..ae9310f 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/components/package-lock.json b/src/components/package-lock.json index d012a45..4601aa1 100644 --- a/src/components/package-lock.json +++ b/src/components/package-lock.json @@ -1,12 +1,12 @@ { "name": "@lingdocs/ps-react", - "version": "7.1.3", + "version": "7.1.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@lingdocs/ps-react", - "version": "7.1.3", + "version": "7.1.4", "license": "MIT", "dependencies": { "@formkit/auto-animate": "^1.0.0-beta.3", diff --git a/src/components/package.json b/src/components/package.json index c747962..1055b42 100644 --- a/src/components/package.json +++ b/src/components/package.json @@ -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", diff --git a/src/lib/package.json b/src/lib/package.json index f387f96..3e4a653 100644 --- a/src/lib/package.json +++ b/src/lib/package.json @@ -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", diff --git a/src/lib/src/pashto-inflector.test.ts b/src/lib/src/pashto-inflector.test.ts index 38a3793..e80e338 100644 --- a/src/lib/src/pashto-inflector.test.ts +++ b/src/lib/src/pashto-inflector.test.ts @@ -850,15 +850,38 @@ 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.", }, @@ -866,12 +889,12 @@ const nouns: { 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" }, ], ], }, diff --git a/src/lib/src/pashto-inflector.ts b/src/lib/src/pashto-inflector.ts index abc0dfe..db1af77 100644 --- a/src/lib/src/pashto-inflector.ts +++ b/src/lib/src/pashto-inflector.ts @@ -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); @@ -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 = @@ -630,7 +649,6 @@ function makePlural( ]); } else { return addSecondInf([ - concatPsString(baseWOutAccents, space, { p: "یان", f: "yáan" }), concatPsString(baseWOutAccents, space, { p: "ګان", f: "gáan" }), ]); } @@ -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) {