ability to blank out predicate in EP compiling

This commit is contained in:
adueck 2023-01-13 16:34:08 +05:00
parent 0c9bf1df50
commit ea5196c803
5 changed files with 8 additions and 6 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "pashto-inflector", "name": "pashto-inflector",
"version": "5.3.2", "version": "5.3.3",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "pashto-inflector", "name": "pashto-inflector",
"version": "5.3.2", "version": "5.3.3",
"hasInstallScript": true, "hasInstallScript": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {

View File

@ -1,6 +1,6 @@
{ {
"name": "pashto-inflector", "name": "pashto-inflector",
"version": "5.3.2", "version": "5.3.3",
"author": "lingdocs.com", "author": "lingdocs.com",
"description": "A Pashto inflection and verb conjugation engine, inculding React components for displaying Pashto text, inflections, and conjugations", "description": "A Pashto inflection and verb conjugation engine, inculding React components for displaying Pashto text, inflections, and conjugations",
"homepage": "https://verbs.lingdocs.com", "homepage": "https://verbs.lingdocs.com",

View File

@ -1,6 +1,6 @@
{ {
"name": "@lingdocs/ps-react", "name": "@lingdocs/ps-react",
"version": "5.3.2", "version": "5.3.3",
"description": "Pashto inflector library module with React components", "description": "Pashto inflector library module with React components",
"main": "dist/components/library.js", "main": "dist/components/library.js",
"module": "dist/components/library.js", "module": "dist/components/library.js",

View File

@ -1,6 +1,6 @@
{ {
"name": "@lingdocs/inflect", "name": "@lingdocs/inflect",
"version": "5.3.2", "version": "5.3.3",
"description": "Pashto inflector library", "description": "Pashto inflector library",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/lib/library.d.ts", "types": "dist/lib/library.d.ts",

View File

@ -37,6 +37,7 @@ type BlankoutOptions = {
kidsSection?: boolean, kidsSection?: boolean,
verb?: boolean, verb?: boolean,
negative?: boolean, negative?: boolean,
predicate?: boolean,
}; };
// function compilePs({ blocks, kids, verb: { head, rest }, VP }: CompilePsInput): T.SingleOrLengthOpts<T.PsString[]> { // function compilePs({ blocks, kids, verb: { head, rest }, VP }: CompilePsInput): T.SingleOrLengthOpts<T.PsString[]> {
@ -176,7 +177,8 @@ function combineIntoText(piecesWVars: (T.Block | T.Kid | T.PsString)[][], subjec
? [first] ? [first]
: ( : (
(blankOut?.equative && "block" in first && first.block.type === "equative") || (blankOut?.equative && "block" in first && first.block.type === "equative") ||
(blankOut?.verb && "block" in first && isRenderedVerbB(first.block)) (blankOut?.verb && "block" in first && isRenderedVerbB(first.block)) ||
(blankOut?.predicate && "block" in first && first.block.type === "predicateSelection")
) )
? [blank] ? [blank]
: ((blankOut?.ba) && "kid" in first && first.kid.type === "ba") : ((blankOut?.ba) && "kid" in first && first.kid.type === "ba")