From 8b95d8039c6ed4eeabc4c827e44b9c6cc5f7aa7e Mon Sep 17 00:00:00 2001 From: adueck Date: Sat, 14 Jan 2023 18:21:31 +0500 Subject: [PATCH] fixed but with space before adjectives etc --- package-lock.json | 4 ++-- package.json | 2 +- src/components/package.json | 2 +- src/lib/package.json | 2 +- src/lib/src/phrase-building/np-tools.ts | 6 ++++-- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 613b0d0..523064a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "pashto-inflector", - "version": "5.3.4", + "version": "5.3.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "pashto-inflector", - "version": "5.3.4", + "version": "5.3.5", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 6d22702..198d8f8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pashto-inflector", - "version": "5.3.4", + "version": "5.3.5", "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.json b/src/components/package.json index 1cfdbfc..487bc02 100644 --- a/src/components/package.json +++ b/src/components/package.json @@ -1,6 +1,6 @@ { "name": "@lingdocs/ps-react", - "version": "5.3.4", + "version": "5.3.5", "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 7aef36a..a9e2ff0 100644 --- a/src/lib/package.json +++ b/src/lib/package.json @@ -1,6 +1,6 @@ { "name": "@lingdocs/inflect", - "version": "5.3.4", + "version": "5.3.5", "description": "Pashto inflector library", "main": "dist/index.js", "types": "dist/lib/library.d.ts", diff --git a/src/lib/src/phrase-building/np-tools.ts b/src/lib/src/phrase-building/np-tools.ts index d59130b..7b48cde 100644 --- a/src/lib/src/phrase-building/np-tools.ts +++ b/src/lib/src/phrase-building/np-tools.ts @@ -17,7 +17,7 @@ function getBaseAndAdjectives({ selection }: T.Rendered ( // TODO: with variations of adjs? - concatPsString(accum, " ", curr.ps[0]) + concatPsString(accum, (accum.p === "" && accum.f === "") ? "" : " ", curr.ps[0]) ), { p: "", f: "" }), " ", p, @@ -104,9 +104,11 @@ export function getPashtoFromRendered(b: T.Rendered | T.Rendered< }, } : trimOffShrunkenPossesive({ type: "NP", selection: b.selection }); if (trimmed.selection.type === "sandwich") { - return trimmed.selection.inside.selection.possesor + const c = trimmed.selection.inside.selection.possesor ? addPossesor(trimmed.selection.inside.selection.possesor.np, base, subjectsPerson) : base; + console.log({ c }); + return c; } if (trimmed.selection.possesor) { return addPossesor(trimmed.selection.possesor.np, base, subjectsPerson);