fixed big error stemming from enforceObject on the grammaticallyTransitive verb conjugations

This commit is contained in:
adueck 2022-10-11 12:20:59 +05:00
parent 5d707e678d
commit 61332241d4
5 changed files with 22 additions and 12 deletions

4
package-lock.json generated
View File

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

View File

@ -1,6 +1,6 @@
{ {
"name": "pashto-inflector", "name": "pashto-inflector",
"version": "5.1.1", "version": "5.1.2",
"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.1.1", "version": "5.1.2",
"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.1.1", "version": "5.1.2",
"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

@ -566,14 +566,19 @@ function makePassivePerfectContent(info: T.StativeCompoundVerbInfo): T.PerfectCo
function enforceObject(conj: T.VerbConjugation, person: T.Person): T.VerbConjugation { function enforceObject(conj: T.VerbConjugation, person: T.Person): T.VerbConjugation {
const modifyPastInAspect = (as: T.AspectContent): T.AspectContent => ({ 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), nonImperative: allOnePersonInflection(as.nonImperative, person),
future: allOnePersonInflection(as.future, person), future: allOnePersonInflection(as.future, person),
imperative: allOnePersonInflection(as.imperative, person), imperative: allOnePersonInflection(as.imperative, person),
past: allOnePersonVerbForm(as.past, person), past: allOnePersonVerbForm(as.past, person),
habitualPast: allOnePersonInflection(as.habitualPast, person), habitualPast: allOnePersonVerbForm(as.habitualPast, person),
modal: { modal: {
...as.modal, nonImperative: allOnePersonInflection(as.modal.nonImperative, person),
future: allOnePersonInflection(as.modal.future, person),
past: allOnePersonVerbForm(as.modal.past, 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 => ({ 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), halfPerfect: allOnePersonVerbForm(perf.halfPerfect, person),
past: allOnePersonVerbForm(perf.past, person), past: allOnePersonVerbForm(perf.past, person),
present: allOnePersonVerbForm(perf.present, person), present: allOnePersonVerbForm(perf.present, person),
habitual: allOnePersonInflection(perf.habitual, person), habitual: allOnePersonVerbForm(perf.habitual, person),
subjunctive: allOnePersonInflection(perf.subjunctive, person), subjunctive: allOnePersonVerbForm(perf.subjunctive, person),
future: allOnePersonVerbForm(perf.future, person), future: allOnePersonVerbForm(perf.future, person),
wouldBe: allOnePersonVerbForm(perf.wouldBe, person), wouldBe: allOnePersonVerbForm(perf.wouldBe, person),
pastSubjunctive: allOnePersonVerbForm(perf.pastSubjunctive, 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), nonImperative: allOnePersonVerbForm(as.nonImperative, person),
future: allOnePersonVerbForm(as.future, person), future: allOnePersonVerbForm(as.future, person),
past: allOnePersonVerbForm(as.past, person), past: allOnePersonVerbForm(as.past, person),
habitualPast: allOnePersonInflection(as.past, person), habitualPast: allOnePersonVerbForm(as.past, person),
// TODO: check if this is ok modal: {
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),
},
}); });
return { return {
...conj, ...conj,