From 23c9c956925736c46dd8c66b482cae3438442568 Mon Sep 17 00:00:00 2001 From: lingdocs <71590811+lingdocs@users.noreply.github.com> Date: Tue, 28 Jun 2022 20:20:02 -0500 Subject: [PATCH] fix ability verb head issues with compile --- package.json | 2 +- src/lib/phrase-building/compile.ts | 2 +- src/lib/phrase-building/render-vp.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 7350aa4..48dc535 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lingdocs/pashto-inflector", - "version": "3.1.4", + "version": "3.1.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/lib/phrase-building/compile.ts b/src/lib/phrase-building/compile.ts index 84cb3ff..54e01d8 100644 --- a/src/lib/phrase-building/compile.ts +++ b/src/lib/phrase-building/compile.ts @@ -166,7 +166,7 @@ function combineIntoText(piecesWVars: (T.Block | T.Kid | T.PsString)[][], subjec return combine(rest).flatMap(r => ( firstPs.map(fPs => concatPsString( fPs, - (!("p" in first) && "block" in first && first.block.type === "perfectiveHead" && !("p" in next) && (("block" in next && (next.block.type === "verb" || next.block.type === "negative")) || ("kid" in next && next.kid.type === "mini-pronoun"))) + (!("p" in first) && "block" in first && first.block.type === "perfectiveHead" && !("p" in next) && (("block" in next && (next.block.type === "verb" || next.block.type === "negative" || next.block.type === "modalVerbBlock")) || ("kid" in next && next.kid.type === "mini-pronoun"))) ? ((("block" in next && next.block.type === "negative") || ("kid" in next && next.kid.type === "mini-pronoun")) ? { p: "", f: "-" } : "") : " ", r, diff --git a/src/lib/phrase-building/render-vp.ts b/src/lib/phrase-building/render-vp.ts index 8bdd485..2f82061 100644 --- a/src/lib/phrase-building/render-vp.ts +++ b/src/lib/phrase-building/render-vp.ts @@ -469,7 +469,7 @@ function getPsVerbConjugation(conj: T.VerbConjugation, vs: T.VerbSelectionComple const hasBa = hasBaParticle(getLong(verbForm)[0]); if (perfective) { const past = isPastTense(vs.tense); - const splitInfo = conj.info[past ? "root" : "stem"].perfectiveSplit; + const splitInfo = conj.info[(past || isModalTense(vs.tense)) ? "root" : "stem"].perfectiveSplit; if (!splitInfo) return { ps: { head: undefined, rest: verbForm }, hasBa }; // TODO: Either solve this in the inflector or here, it seems silly (or redundant) // to have a length option in the perfective split stem??