From 91d3a10abb8da1adc4b861c3b5a7d6d2d47aeccd Mon Sep 17 00:00:00 2001 From: adueck Date: Fri, 7 Apr 2023 21:36:19 +0400 Subject: [PATCH] bit more --- src/lib/src/new-verb-engine/render-verb.ts | 11 +++++------ src/lib/src/new-verb-engine/roots-and-stems.ts | 12 ++++++------ src/lib/src/new-verb-engine/rs-helpers.ts | 8 ++++---- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/lib/src/new-verb-engine/render-verb.ts b/src/lib/src/new-verb-engine/render-verb.ts index ea5c979..144786a 100644 --- a/src/lib/src/new-verb-engine/render-verb.ts +++ b/src/lib/src/new-verb-engine/render-verb.ts @@ -38,6 +38,8 @@ import { verbEndingConcat } from "./rs-helpers"; // TODO: are azmóyulum and wáayulo really not just azmoyúlum and waayúlo ? // TODO: automatic 3rd person idiosyncronizing of raTul raaTu, shaRul, shaaRu, rasedul rased etc +// IMMEDIATE TODO: shwoo -> shoo + export function renderVerb({ verb, tense, person, voice }: { verb: T.VerbEntry, tense: T.VerbTense | T.PerfectTense | T.AbilityTense, // TODO: make T.Tense @@ -56,7 +58,7 @@ export function renderVerb({ verb, tense, person, voice }: { const isPast = isPastTense(tense); const aspect = getAspect(tense); - const isAbility = isAbilityTense(tense); + const type = isAbilityTense(tense) ? "ability" : "basic"; const genderNumber = { gender: personGender(person), number: personNumber(person), @@ -68,11 +70,8 @@ export function renderVerb({ verb, tense, person, voice }: { rs: isPast ? "root" : "stem", aspect, }, - type: voice === "passive" - ? "passive" - : isAbility - ? "ability" - : "basic", + voice, + type, genderNumber, }); // #2 add the verb ending to it diff --git a/src/lib/src/new-verb-engine/roots-and-stems.ts b/src/lib/src/new-verb-engine/roots-and-stems.ts index a8f3c8c..e94c097 100644 --- a/src/lib/src/new-verb-engine/roots-and-stems.ts +++ b/src/lib/src/new-verb-engine/roots-and-stems.ts @@ -29,16 +29,16 @@ const shVB: T.VBBasic = { ps: [{ p: "ش", f: "sh" }], } -// start basic inflection functions for pattern 1 and pattern ey things -// to be used by inflecting لاړ and participles +// put the past participle in a different function -export function getRootStem({ verb, part, type, genderNumber }: { +export function getRootStem({ verb, part, type, genderNumber, voice }: { verb: T.VerbEntry, part: { rs: "root" | "stem", aspect: T.Aspect, } | "pastPart", - type: "basic" | "ability" | "passive", + voice: "active" | "passive", + type: "basic" | "ability", genderNumber: { gender: T.Gender, number: T.NounNumber, @@ -51,7 +51,7 @@ export function getRootStem({ verb, part, type, genderNumber }: { if (type === "ability") { return getAbilityRs(v, part); } - if (type === "passive") { + if (voice === "passive") { return getPassiveRs(v, part); } return part.rs === "stem" @@ -83,7 +83,7 @@ function getPassiveRs(verb: T.VerbEntryNoFVars, part: { aspect: T.Aspect, rs: "r : getPerfectiveRoot )(verb); const longRoot = getLongVB(basicRoot); - const kedulVba = getRootStem({ verb: kedulStat, part, type: "basic", genderNumber: { gender: "masc", number: "singular" }})[1][0] as T.VBBasic; + const kedulVba = getRootStem({ verb: kedulStat, part, type: "basic", voice: "active", genderNumber: { gender: "masc", number: "singular" }})[1][0] as T.VBBasic; return [ vHead, [weld(longRoot, kedulVba)], diff --git a/src/lib/src/new-verb-engine/rs-helpers.ts b/src/lib/src/new-verb-engine/rs-helpers.ts index e0bfb66..8410f08 100644 --- a/src/lib/src/new-verb-engine/rs-helpers.ts +++ b/src/lib/src/new-verb-engine/rs-helpers.ts @@ -26,12 +26,12 @@ export function getAllRs(verb: T.VerbEntry): { } { return { stem: { - perfective: getRootStem({ verb, type: "basic", part: { rs: "stem", aspect: "perfective" }, genderNumber: { gender: "masc", number: "singular" } }), - imperfective: getRootStem({ verb, type: "basic", part: { rs: "stem", aspect: "imperfective" }, genderNumber: { gender: "masc", number: "singular" } }), + perfective: getRootStem({ verb, type: "basic", voice: "active", part: { rs: "stem", aspect: "perfective" }, genderNumber: { gender: "masc", number: "singular" } }), + imperfective: getRootStem({ verb, type: "basic", voice: "active", part: { rs: "stem", aspect: "imperfective" }, genderNumber: { gender: "masc", number: "singular" } }), }, root: { - perfective: getRootStem({ verb, type: "basic", part: { rs: "root", aspect: "perfective" }, genderNumber: { gender: "masc", number: "singular" } }), - imperfective: getRootStem({ verb, type: "basic", part: { rs: "root", aspect: "imperfective" }, genderNumber: { gender: "masc", number: "singular" } }), + perfective: getRootStem({ verb, type: "basic", voice: "active", part: { rs: "root", aspect: "perfective" }, genderNumber: { gender: "masc", number: "singular" } }), + imperfective: getRootStem({ verb, type: "basic", voice: "active", part: { rs: "root", aspect: "imperfective" }, genderNumber: { gender: "masc", number: "singular" } }), }, }; }