From 635a2cd80526315350a899e6eefd4b72fe74af10 Mon Sep 17 00:00:00 2001 From: adueck Date: Mon, 8 Jul 2024 13:28:30 -0400 Subject: [PATCH] =?UTF-8?q?plural=20from=20for=20words=20like=20=D9=82?= =?UTF-8?q?=D8=A7=D8=B6=DB=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 1 + 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 | 30 ++++++++++++++++++++++++++++ src/lib/src/pashto-inflector.ts | 5 ++++- 8 files changed, 42 insertions(+), 8 deletions(-) create mode 100644 .env diff --git a/.env b/.env new file mode 100644 index 0000000..7d910f1 --- /dev/null +++ b/.env @@ -0,0 +1 @@ +SKIP_PREFLIGHT_CHECK=true \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 0f0c093..5a6506a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "pashto-inflector", - "version": "7.1.6", + "version": "7.1.7", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "pashto-inflector", - "version": "7.1.6", + "version": "7.1.7", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 005c7aa..ed519f0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pashto-inflector", - "version": "7.1.6", + "version": "7.1.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", diff --git a/src/components/package-lock.json b/src/components/package-lock.json index 87e126e..8218fa8 100644 --- a/src/components/package-lock.json +++ b/src/components/package-lock.json @@ -1,12 +1,12 @@ { "name": "@lingdocs/ps-react", - "version": "7.1.6", + "version": "7.1.7", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@lingdocs/ps-react", - "version": "7.1.6", + "version": "7.1.7", "license": "MIT", "dependencies": { "@formkit/auto-animate": "^1.0.0-beta.3", diff --git a/src/components/package.json b/src/components/package.json index ce2f26a..e7dd1b6 100644 --- a/src/components/package.json +++ b/src/components/package.json @@ -1,6 +1,6 @@ { "name": "@lingdocs/ps-react", - "version": "7.1.6", + "version": "7.1.7", "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 d457143..b24c0b5 100644 --- a/src/lib/package.json +++ b/src/lib/package.json @@ -1,6 +1,6 @@ { "name": "@lingdocs/inflect", - "version": "7.1.6", + "version": "7.1.7", "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 46b7cfa..9afbc86 100644 --- a/src/lib/src/pashto-inflector.test.ts +++ b/src/lib/src/pashto-inflector.test.ts @@ -1434,6 +1434,36 @@ const nouns: { }, }, }, + { + in: { + ts: 1527823526, + i: 12229, + p: "قاضۍ", + f: "qaazúy", + g: "kaazuy", + e: "female judge", + r: 4, + c: "n. f. anim.", + }, + out: { + inflections: { + fem: [ + [{ p: "قاضۍ", f: "qaazúy" }], + [{ p: "قاضۍ", f: "qaazúy" }], + [ + { p: "قاضیو", f: "qaazúyo" }, + { p: "قاضو", f: "qaazó" }, + ], + ], + }, + plural: { + fem: [ + [{ p: "قاضیانې", f: "qaaziyáane" }], + [{ p: "قاضیانو", f: "qaaziyáano" }], + ], + }, + }, + }, // Feminine regular ending in ا { in: { diff --git a/src/lib/src/pashto-inflector.ts b/src/lib/src/pashto-inflector.ts index 5643640..943d7ea 100644 --- a/src/lib/src/pashto-inflector.ts +++ b/src/lib/src/pashto-inflector.ts @@ -752,7 +752,10 @@ function makePlural( }, }; } - if (type === "fem noun" && endsWith({ p: "ي" }, w)) { + if ( + type === "fem noun" && + (endsWith({ p: "ي" }, w) || (endsWith({ p: "ۍ" }, w) && anim)) + ) { return { arabicPlural, plural: {