added in habitual past tenses

This commit is contained in:
lingdocs 2022-03-29 14:53:32 +05:00
parent a8271c3eb1
commit 90fec81da9
5 changed files with 35 additions and 8 deletions

View File

@ -5,7 +5,7 @@
"dependencies": { "dependencies": {
"@fortawesome/fontawesome-free": "^5.15.4", "@fortawesome/fontawesome-free": "^5.15.4",
"@lingdocs/lingdocs-main": "^0.2.0", "@lingdocs/lingdocs-main": "^0.2.0",
"@lingdocs/pashto-inflector": "^1.5.7", "@lingdocs/pashto-inflector": "^1.5.9",
"@testing-library/jest-dom": "^5.11.4", "@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0", "@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10", "@testing-library/user-event": "^12.1.10",

View File

@ -29,6 +29,12 @@ const tenseOptions: { label: string, value: VerbTense }[] = [{
}, { }, {
label: "continuous past", label: "continuous past",
value: "imperfectivePast", value: "imperfectivePast",
}, {
label: "habitual simp. past.",
value: "habitualPerfectivePast",
}, {
label: "habitual cont. past.",
value: "habitualImperfectivePast",
}]; }];
// type Filters = { // type Filters = {

View File

@ -201,6 +201,14 @@ function renderEnglishVPBase({ subjectPerson, object, vs }: {
: (n ? ` did not ${ec[0]}` : ` ${ec[3]}`) : (n ? ` did not ${ec[0]}` : ` ${ec[3]}`)
}` }`
]), ]),
habitualPerfectivePast: (s: T.Person, ec: T.EnglishVerbConjugationEc, n: boolean) => ([
`$SUBJ would${n ? " not" : ""} ${isToBe(ec) ? "be" : ec[0]}`,
`$SUBJ used to${n ? " not" : ""} ${isToBe(ec) ? "be" : ec[0]}`,
]),
habitualImperfectivePast: (s: T.Person, ec: T.EnglishVerbConjugationEc, n: boolean) => ([
`$SUBJ would${n ? " not" : ""} ${isToBe(ec) ? "be" : ec[0]}`,
`$SUBJ used to${n ? " not" : ""} ${isToBe(ec) ? "be" : ec[0]}`,
]),
}; };
const base = builders[tense](subjectPerson, ec, vs.negative); const base = builders[tense](subjectPerson, ec, vs.negative);
return base.map(b => `${b}${typeof object === "object" ? " $OBJ" : ""}${ep ? ` ${ep}` : ""}`); return base.map(b => `${b}${typeof object === "object" ? " $OBJ" : ""}${ep ? ` ${ep}` : ""}`);
@ -324,6 +332,12 @@ function getTenseVerbForm(conj: T.VerbConjugation, tense: VerbTense): T.VerbForm
if (tense === "perfectivePast") { if (tense === "perfectivePast") {
return conj.perfective.past; return conj.perfective.past;
} }
if (tense === "habitualImperfectivePast") {
return conj.imperfective.habitualPast;
}
if (tense === "habitualPerfectivePast") {
return conj.perfective.habitualPast;
}
throw new Error("unknown tense"); throw new Error("unknown tense");
} }
@ -395,10 +409,10 @@ function isFirstOrSecondPersPronoun(o: "none" | NPSelection | T.Person.ThirdPlur
} }
function isPerfective(t: VerbTense): boolean { function isPerfective(t: VerbTense): boolean {
if (t === "present" || t === "imperfectiveFuture" || t === "imperfectivePast") { if (t === "present" || t === "imperfectiveFuture" || t === "imperfectivePast" || t === "habitualImperfectivePast") {
return false; return false;
} }
if (t === "perfectiveFuture" || t === "subjunctive" || t === "perfectivePast") { if (t === "perfectiveFuture" || t === "subjunctive" || t === "perfectivePast" || t === "habitualPerfectivePast") {
return true; return true;
} }
throw new Error("tense not implemented yet"); throw new Error("tense not implemented yet");

View File

@ -26,7 +26,14 @@ type VPRendered = {
englishBase?: string[], englishBase?: string[],
} }
type VerbTense = "present" | "subjunctive" | "perfectiveFuture" | "imperfectiveFuture" | "perfectivePast" | "imperfectivePast"; type VerbTense = "present"
| "subjunctive"
| "perfectiveFuture"
| "imperfectiveFuture"
| "perfectivePast"
| "imperfectivePast"
| "habitualPerfectivePast"
| "habitualImperfectivePast";
type VerbSelection = { type VerbSelection = {
type: "verb", type: "verb",

View File

@ -1684,10 +1684,10 @@
pbf "^3.2.1" pbf "^3.2.1"
rambda "^6.7.0" rambda "^6.7.0"
"@lingdocs/pashto-inflector@^1.5.7": "@lingdocs/pashto-inflector@^1.5.9":
version "1.5.7" version "1.5.9"
resolved "https://npm.lingdocs.com/@lingdocs%2fpashto-inflector/-/pashto-inflector-1.5.7.tgz#bf13805208ed6d62eee6f11e809baef7c603a124" resolved "https://npm.lingdocs.com/@lingdocs%2fpashto-inflector/-/pashto-inflector-1.5.9.tgz#a5d13b71b39f989aab97fc86aff8e586404a5cde"
integrity sha512-4SS8Qgab2RkDAup4ODxA3J5R0nHHgUj/9grVO0zozq36lFwuvARhsSNp9kPPTAb++1kih7yKyW7HG5NGYavSlw== integrity sha512-ApWnlTwutQbgbXzh7kCwUJ3nVUISgd8C4O0pkIMIZwkXX8/3ItBEm4+9tHuvuIqBW3qrIDa7+iUNk957Lr39mw==
dependencies: dependencies:
classnames "^2.2.6" classnames "^2.2.6"
pbf "^3.2.1" pbf "^3.2.1"