From 6aa7c9a36e94b4d2a6b83a35ebb5b55b4fe784a9 Mon Sep 17 00:00:00 2001 From: lingdocs <71590811+lingdocs@users.noreply.github.com> Date: Mon, 4 Oct 2021 23:27:26 -0400 Subject: [PATCH] verbBlokPosFromPerson --- src/lib/conjugation-forms.tsx | 6 +++--- src/lib/misc-helpers.ts | 4 ++-- src/lib/p-text-helpers.test.ts | 1 - src/lib/p-text-helpers.ts | 4 ++-- src/library.ts | 2 ++ 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/lib/conjugation-forms.tsx b/src/lib/conjugation-forms.tsx index 44ee94c..fc6f7d0 100644 --- a/src/lib/conjugation-forms.tsx +++ b/src/lib/conjugation-forms.tsx @@ -26,7 +26,7 @@ import { getPersonInflectionsKey, pickPersInf, getPersonFromVerbForm, - getBlockRowCol, + getVerbBlockPosFromPerson, } from "./misc-helpers"; import addPronouns from "./add-pronouns"; import * as T from "../types"; @@ -645,7 +645,7 @@ const formsOfConjugation = (conj: T.VerbConjugation): T.DisplayFormItem[] => [ : [], ]; -export const getForms = ({ conj, filterFunc, mode, subject, object, sentenceLevel, englishConjugation, negative } : { +export const getForms = ({ conj, filterFunc, mode, subject, object, sentenceLevel, englishConjugation, negative }: { conj: T.VerbConjugation, englishConjugation?: T.EnglishVerbConjugation filterFunc?: FilterFunc | FilterFunc[], @@ -685,7 +685,7 @@ function engPresC(s: T.Person, ec: T.EnglishVerbConjugationEc | [string, string] } function engEquative(tense: "past" | "present", s: T.Person): string { - const [row, col] = getBlockRowCol(s); + const [row, col] = getVerbBlockPosFromPerson(s); return englishEquative[tense][row][col]; } diff --git a/src/lib/misc-helpers.ts b/src/lib/misc-helpers.ts index 7aa5698..5066dce 100644 --- a/src/lib/misc-helpers.ts +++ b/src/lib/misc-helpers.ts @@ -114,11 +114,11 @@ export function getPersonFromVerbForm(form: T.SingleOrLengthOpts, p } : {}, }; } - const [row, col] = getBlockRowCol(person); + const [row, col] = getVerbBlockPosFromPerson(person); return form[row][col]; } -export function getBlockRowCol(person: T.Person): [0 | 1 | 2 | 3 | 4 | 5, 0 | 1] { +export function getVerbBlockPosFromPerson(person: T.Person): [0 | 1 | 2 | 3 | 4 | 5, 0 | 1] { const plural = personIsPlural(person) const row = (plural ? (person - 6) : person) as 0 | 1 | 2 | 3 | 4 | 5; const col = plural ? 1 : 0; diff --git a/src/lib/p-text-helpers.test.ts b/src/lib/p-text-helpers.test.ts index 5c95b76..21af42e 100644 --- a/src/lib/p-text-helpers.test.ts +++ b/src/lib/p-text-helpers.test.ts @@ -24,7 +24,6 @@ import { addOEnding, removeFVarients, endsInShwa, - removeAynEnding, splitPsByVarients, } from "./p-text-helpers"; import * as T from "../types"; diff --git a/src/lib/p-text-helpers.ts b/src/lib/p-text-helpers.ts index 1a4ff0e..c8713c4 100644 --- a/src/lib/p-text-helpers.ts +++ b/src/lib/p-text-helpers.ts @@ -11,7 +11,7 @@ import { } from "./pashto-inflector"; import { baParticle } from "./grammar-units"; import { - getBlockRowCol, + getVerbBlockPosFromPerson, getPersonInflectionsKey, } from "./misc-helpers"; import * as T from "../types"; @@ -562,7 +562,7 @@ export function allOnePersonVerbForm(block: T.VerbForm, person: T.Person): T.Ver } : {}, }; } - const [row, col] = getBlockRowCol(person) + const [row, col] = getVerbBlockPosFromPerson(person) const p = block[row][col]; return [ [p, p], diff --git a/src/library.ts b/src/library.ts index 2e8ef0e..81749dd 100644 --- a/src/library.ts +++ b/src/library.ts @@ -72,6 +72,7 @@ import { getPersonFromVerbForm, getPersonNumber, personFromVerbBlockPos, + getVerbBlockPosFromPerson, } from "./lib/misc-helpers"; import { simplifyPhonetics, @@ -122,6 +123,7 @@ export { removeAccents, hasAccents, getEnglishWord, + getVerbBlockPosFromPerson, // protobuf helpers readDictionary, writeDictionary,