fix english sentence building for EP

This commit is contained in:
lingdocs 2022-06-11 17:25:26 -04:00
parent f06e3d8341
commit 46c8c815f2
2 changed files with 5 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@lingdocs/pashto-inflector",
"version": "2.8.9",
"version": "2.9.0",
"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

@ -31,6 +31,7 @@ export function renderEP(EP: T.EPSelectionComplete): T.EPRendered {
function getEPSBlocksAndKids(EP: T.EPSelectionComplete): { kids: T.Kid[], blocks: T.Block[], englishEquativePerson: T.Person } {
const subject = getSubjectSelection(EP.blocks).selection;
const subjectPerson = getPersonFromNP(subject);
const commandingNP: T.NPSelection = subject.selection.type === "pronoun"
? subject
: EP.predicate.selection.type === "NP"
@ -57,7 +58,9 @@ function getEPSBlocksAndKids(EP: T.EPSelectionComplete): { kids: T.Kid[], blocks
return {
blocks,
kids,
englishEquativePerson: commandingNP.selection.type === "participle" ? T.Person.ThirdSingMale : commandingPerson,
englishEquativePerson: subject.selection.type === "participle"
? T.Person.ThirdSingMale
: subjectPerson,
};
}