fixed but with space before adjectives etc

This commit is contained in:
adueck 2023-01-14 18:21:31 +05:00
parent db458f291c
commit 8b95d8039c
5 changed files with 9 additions and 7 deletions

4
package-lock.json generated
View File

@ -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": {

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -17,7 +17,7 @@ function getBaseAndAdjectives({ selection }: T.Rendered<T.NPSelection | T.Comple
concatPsString(
adjs.reduce((accum, curr) => (
// 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.NPSelection> | 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);