fix issue with pu ... sandwiches inflecting

This commit is contained in:
adueck 2022-11-01 20:13:59 +05:00
parent 64265e9e20
commit 39c868f0a2
5 changed files with 8 additions and 8 deletions

4
package-lock.json generated
View File

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

View File

@ -1,6 +1,6 @@
{
"name": "pashto-inflector",
"version": "5.1.5",
"version": "5.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",

View File

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

View File

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

View File

@ -14,11 +14,11 @@ export function renderSandwich(s: T.SandwichSelection<T.Sandwich>): T.Rendered<T
inflectInside,
"subject",
"none",
isPuSandwich(s),
isPuLocationSandwich(s),
),
};
}
function isPuSandwich(s: T.SandwichSelection<T.Sandwich>): boolean {
return s.before?.p === "په";
function isPuLocationSandwich(s: T.SandwichSelection<T.Sandwich>): boolean {
return s.before?.p === "په" && !!["کې", "کښې", "باندې"].includes(s.after?.p || "")
}