From 61332241d46f0dab57ec6dabd781cd1823498b55 Mon Sep 17 00:00:00 2001 From: adueck Date: Tue, 11 Oct 2022 12:20:59 +0500 Subject: [PATCH] fixed big error stemming from enforceObject on the grammaticallyTransitive verb conjugations --- package-lock.json | 4 ++-- package.json | 2 +- src/components/package.json | 2 +- src/lib/package.json | 2 +- src/lib/src/verb-conjugation.ts | 24 +++++++++++++++++------- 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5954cc8..9480780 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "pashto-inflector", - "version": "5.1.1", + "version": "5.1.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "pashto-inflector", - "version": "5.1.1", + "version": "5.1.2", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 8ac3d97..cc61b54 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pashto-inflector", - "version": "5.1.1", + "version": "5.1.2", "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/components/package.json b/src/components/package.json index 4fdbd2e..f29326b 100644 --- a/src/components/package.json +++ b/src/components/package.json @@ -1,6 +1,6 @@ { "name": "@lingdocs/ps-react", - "version": "5.1.1", + "version": "5.1.2", "description": "Pashto inflector library module with React components", "main": "dist/components/library.js", "module": "dist/components/library.js", diff --git a/src/lib/package.json b/src/lib/package.json index 283da7a..19a8f3b 100644 --- a/src/lib/package.json +++ b/src/lib/package.json @@ -1,6 +1,6 @@ { "name": "@lingdocs/inflect", - "version": "5.1.1", + "version": "5.1.2", "description": "Pashto inflector library", "main": "dist/index.js", "types": "dist/lib/library.d.ts", diff --git a/src/lib/src/verb-conjugation.ts b/src/lib/src/verb-conjugation.ts index 8d9559e..0fba58b 100644 --- a/src/lib/src/verb-conjugation.ts +++ b/src/lib/src/verb-conjugation.ts @@ -566,14 +566,19 @@ function makePassivePerfectContent(info: T.StativeCompoundVerbInfo): T.PerfectCo function enforceObject(conj: T.VerbConjugation, person: T.Person): T.VerbConjugation { const modifyPastInAspect = (as: T.AspectContent): T.AspectContent => ({ + // WATCH OUT FOR DIFFERENCES WITH allOnePersonInflection (for the object w/ present tense) + // AND allOnePersonVerbForm (for the object w/ past tense object) nonImperative: allOnePersonInflection(as.nonImperative, person), future: allOnePersonInflection(as.future, person), imperative: allOnePersonInflection(as.imperative, person), past: allOnePersonVerbForm(as.past, person), - habitualPast: allOnePersonInflection(as.habitualPast, person), + habitualPast: allOnePersonVerbForm(as.habitualPast, person), modal: { - ...as.modal, + nonImperative: allOnePersonInflection(as.modal.nonImperative, person), + future: allOnePersonInflection(as.modal.future, person), past: allOnePersonVerbForm(as.modal.past, person), + habitualPast: allOnePersonVerbForm(as.modal.habitualPast, person), + hypotheticalPast: allOnePersonVerbForm(as.modal.hypotheticalPast, person), }, }); const modifyParticiple = (part: T.ParticipleContent): T.ParticipleContent => ({ @@ -585,8 +590,8 @@ function enforceObject(conj: T.VerbConjugation, person: T.Person): T.VerbConjuga halfPerfect: allOnePersonVerbForm(perf.halfPerfect, person), past: allOnePersonVerbForm(perf.past, person), present: allOnePersonVerbForm(perf.present, person), - habitual: allOnePersonInflection(perf.habitual, person), - subjunctive: allOnePersonInflection(perf.subjunctive, person), + habitual: allOnePersonVerbForm(perf.habitual, person), + subjunctive: allOnePersonVerbForm(perf.subjunctive, person), future: allOnePersonVerbForm(perf.future, person), wouldBe: allOnePersonVerbForm(perf.wouldBe, person), pastSubjunctive: allOnePersonVerbForm(perf.pastSubjunctive, person), @@ -597,9 +602,14 @@ function enforceObject(conj: T.VerbConjugation, person: T.Person): T.VerbConjuga nonImperative: allOnePersonVerbForm(as.nonImperative, person), future: allOnePersonVerbForm(as.future, person), past: allOnePersonVerbForm(as.past, person), - habitualPast: allOnePersonInflection(as.past, person), - // TODO: check if this is ok - modal: as.modal, + habitualPast: allOnePersonVerbForm(as.past, person), + modal: { + nonImperative: allOnePersonInflection(as.modal.nonImperative, person), + future: allOnePersonInflection(as.modal.future, person), + past: allOnePersonVerbForm(as.modal.past, person), + habitualPast: allOnePersonVerbForm(as.modal.habitualPast, person), + hypotheticalPast: allOnePersonVerbForm(as.modal.hypotheticalPast, person), + }, }); return { ...conj,