verbBlokPosFromPerson

This commit is contained in:
lingdocs 2021-10-04 23:27:26 -04:00
parent 4a2408f197
commit 6aa7c9a36e
5 changed files with 9 additions and 8 deletions

View File

@ -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];
}

View File

@ -114,11 +114,11 @@ export function getPersonFromVerbForm(form: T.SingleOrLengthOpts<T.VerbBlock>, 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;

View File

@ -24,7 +24,6 @@ import {
addOEnding,
removeFVarients,
endsInShwa,
removeAynEnding,
splitPsByVarients,
} from "./p-text-helpers";
import * as T from "../types";

View File

@ -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],

View File

@ -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,