From faecbcf83eb1802d9661d532a1feef5802837f89 Mon Sep 17 00:00:00 2001 From: lingdocs <71590811+lingdocs@users.noreply.github.com> Date: Wed, 25 May 2022 18:57:20 -0500 Subject: [PATCH] bug rendering english VP --- package.json | 2 +- src/lib/phrase-building/compile.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 34b8301..00f22ac 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lingdocs/pashto-inflector", - "version": "2.6.0", + "version": "2.6.1", "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/lib/phrase-building/compile.ts b/src/lib/phrase-building/compile.ts index 69fa6e9..ace3ca3 100644 --- a/src/lib/phrase-building/compile.ts +++ b/src/lib/phrase-building/compile.ts @@ -384,14 +384,14 @@ function compileEnglishVP(VP: T.VPRendered): string[] | undefined { } const engSubj = getRenderedSubjectSelection(VP.blocks).selection; const obj = getRenderedObjectSelection(VP.blocks).selection; - const engObj = typeof obj === "object" ? obj.e : ""; + const engObj = typeof obj === "object" ? obj : undefined; const engAPs = getEnglishAPs(VP.blocks); // require all English parts for making the English phrase return (VP.englishBase && engSubj && engObj !== undefined) ? VP.englishBase.map(e => insertEWords(e, { // TODO: make sure we actually have the english subject: getEnglishFromRendered(engSubj) || "", - object: getEnglishFromRendered(engSubj) || "", + object: engObj ? getEnglishFromRendered(engObj) : "", APs: engAPs, })) : undefined;