From 54b42b7e709421ac9968038f21ebae88122d58a5 Mon Sep 17 00:00:00 2001 From: lingdocs <71590811+lingdocs@users.noreply.github.com> Date: Mon, 12 Sep 2022 17:59:59 +0400 Subject: [PATCH] ability to leave out negatives --- package.json | 2 +- src/lib/phrase-building/compile.ts | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4abde1f..61e951e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lingdocs/pashto-inflector", - "version": "3.8.9", + "version": "3.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", diff --git a/src/lib/phrase-building/compile.ts b/src/lib/phrase-building/compile.ts index 5f7ae78..5e5685a 100644 --- a/src/lib/phrase-building/compile.ts +++ b/src/lib/phrase-building/compile.ts @@ -31,7 +31,13 @@ import { } from "../../lib/misc-helpers"; -type BlankoutOptions = { equative?: boolean, ba?: boolean, kidsSection?: boolean, verb?: boolean }; +type BlankoutOptions = { + equative?: boolean, + ba?: boolean, + kidsSection?: boolean, + verb?: boolean, + negative?: boolean, +}; // function compilePs({ blocks, kids, verb: { head, rest }, VP }: CompilePsInput): T.SingleOrLengthOpts { // if ("long" in rest) { @@ -175,6 +181,8 @@ function combineIntoText(piecesWVars: (T.Block | T.Kid | T.PsString)[][], subjec ? [blank] : ((blankOut?.ba) && "kid" in first && first.kid.type === "ba") ? [kidsBlank] + : (blankOut?.negative && "block" in first && first.block.type === "negative") + ? [{ p: "", f: "" }] : getPsFromPiece(first, subjectPerson); if (!rest.length) { return firstPs;