allow fem inflected plural form as well for animate nouns

This commit is contained in:
adueck 2023-01-13 14:56:41 +05:00
parent f0f0756bd4
commit 0c9bf1df50
6 changed files with 10 additions and 9 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "pashto-inflector", "name": "pashto-inflector",
"version": "5.3.1", "version": "5.3.2",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "pashto-inflector", "name": "pashto-inflector",
"version": "5.3.1", "version": "5.3.2",
"hasInstallScript": true, "hasInstallScript": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {

View File

@ -1,6 +1,6 @@
{ {
"name": "pashto-inflector", "name": "pashto-inflector",
"version": "5.3.1", "version": "5.3.2",
"author": "lingdocs.com", "author": "lingdocs.com",
"description": "A Pashto inflection and verb conjugation engine, inculding React components for displaying Pashto text, inflections, and conjugations", "description": "A Pashto inflection and verb conjugation engine, inculding React components for displaying Pashto text, inflections, and conjugations",
"homepage": "https://verbs.lingdocs.com", "homepage": "https://verbs.lingdocs.com",

View File

@ -1,6 +1,6 @@
{ {
"name": "@lingdocs/ps-react", "name": "@lingdocs/ps-react",
"version": "5.3.1", "version": "5.3.2",
"description": "Pashto inflector library module with React components", "description": "Pashto inflector library module with React components",
"main": "dist/components/library.js", "main": "dist/components/library.js",
"module": "dist/components/library.js", "module": "dist/components/library.js",

View File

@ -1,6 +1,6 @@
{ {
"name": "@lingdocs/inflect", "name": "@lingdocs/inflect",
"version": "5.3.1", "version": "5.3.2",
"description": "Pashto inflector library", "description": "Pashto inflector library",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/lib/library.d.ts", "types": "dist/lib/library.d.ts",

View File

@ -31,7 +31,6 @@ import {
} from "./accent-helpers"; } from "./accent-helpers";
import * as T from "../../types"; import * as T from "../../types";
import { splitFIntoPhonemes } from "./phonetics-to-diacritics"; import { splitFIntoPhonemes } from "./phonetics-to-diacritics";
import { isNounEntry } from "./type-predicates";
const endingInSingleARegex = /[^a]'??[aá]'??$/; const endingInSingleARegex = /[^a]'??[aá]'??$/;
const endingInHeyOrAynRegex = /[^ا][هع]$/; const endingInHeyOrAynRegex = /[^ا][هع]$/;

View File

@ -27,7 +27,7 @@ export function renderNPSelection(NP: T.NPSelection, inflected: boolean, inflect
} }
if (NP.selection.type === "noun") { if (NP.selection.type === "noun") {
return { return {
type: "NP", type: "NP",
selection: renderNounSelection(NP.selection, inflected, soRole, undefined, isPuSandwich), selection: renderNounSelection(NP.selection, inflected, soRole, undefined, isPuSandwich),
}; };
} }
@ -58,8 +58,10 @@ export function renderNounSelection(n: T.NounSelection, inflected: boolean, role
return [ return [
...plural, ...plural,
...getInf(infs, "arabicPlural", n.gender, true, inflected), ...getInf(infs, "arabicPlural", n.gender, true, inflected),
// TODO: if it's an INANIMATE NOUN and it inflects allow the inflected form too? ...(!plural.length || n.gender === "fem")
...!plural.length ? getInf(infs, "inflections", n.gender, true, inflected) : [], // allow for plurals like ډاکټرې as well as ډاکټرانې
? getInf(infs, "inflections", n.gender, true, inflected)
: [],
]; ];
})(); })();
return ps.length > 0 return ps.length > 0