verbBlokPosFromPerson
This commit is contained in:
parent
4a2408f197
commit
6aa7c9a36e
|
@ -26,7 +26,7 @@ import {
|
||||||
getPersonInflectionsKey,
|
getPersonInflectionsKey,
|
||||||
pickPersInf,
|
pickPersInf,
|
||||||
getPersonFromVerbForm,
|
getPersonFromVerbForm,
|
||||||
getBlockRowCol,
|
getVerbBlockPosFromPerson,
|
||||||
} from "./misc-helpers";
|
} from "./misc-helpers";
|
||||||
import addPronouns from "./add-pronouns";
|
import addPronouns from "./add-pronouns";
|
||||||
import * as T from "../types";
|
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,
|
conj: T.VerbConjugation,
|
||||||
englishConjugation?: T.EnglishVerbConjugation
|
englishConjugation?: T.EnglishVerbConjugation
|
||||||
filterFunc?: FilterFunc | FilterFunc[],
|
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 {
|
function engEquative(tense: "past" | "present", s: T.Person): string {
|
||||||
const [row, col] = getBlockRowCol(s);
|
const [row, col] = getVerbBlockPosFromPerson(s);
|
||||||
return englishEquative[tense][row][col];
|
return englishEquative[tense][row][col];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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];
|
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 plural = personIsPlural(person)
|
||||||
const row = (plural ? (person - 6) : person) as 0 | 1 | 2 | 3 | 4 | 5;
|
const row = (plural ? (person - 6) : person) as 0 | 1 | 2 | 3 | 4 | 5;
|
||||||
const col = plural ? 1 : 0;
|
const col = plural ? 1 : 0;
|
||||||
|
|
|
@ -24,7 +24,6 @@ import {
|
||||||
addOEnding,
|
addOEnding,
|
||||||
removeFVarients,
|
removeFVarients,
|
||||||
endsInShwa,
|
endsInShwa,
|
||||||
removeAynEnding,
|
|
||||||
splitPsByVarients,
|
splitPsByVarients,
|
||||||
} from "./p-text-helpers";
|
} from "./p-text-helpers";
|
||||||
import * as T from "../types";
|
import * as T from "../types";
|
||||||
|
|
|
@ -11,7 +11,7 @@ import {
|
||||||
} from "./pashto-inflector";
|
} from "./pashto-inflector";
|
||||||
import { baParticle } from "./grammar-units";
|
import { baParticle } from "./grammar-units";
|
||||||
import {
|
import {
|
||||||
getBlockRowCol,
|
getVerbBlockPosFromPerson,
|
||||||
getPersonInflectionsKey,
|
getPersonInflectionsKey,
|
||||||
} from "./misc-helpers";
|
} from "./misc-helpers";
|
||||||
import * as T from "../types";
|
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];
|
const p = block[row][col];
|
||||||
return [
|
return [
|
||||||
[p, p],
|
[p, p],
|
||||||
|
|
|
@ -72,6 +72,7 @@ import {
|
||||||
getPersonFromVerbForm,
|
getPersonFromVerbForm,
|
||||||
getPersonNumber,
|
getPersonNumber,
|
||||||
personFromVerbBlockPos,
|
personFromVerbBlockPos,
|
||||||
|
getVerbBlockPosFromPerson,
|
||||||
} from "./lib/misc-helpers";
|
} from "./lib/misc-helpers";
|
||||||
import {
|
import {
|
||||||
simplifyPhonetics,
|
simplifyPhonetics,
|
||||||
|
@ -122,6 +123,7 @@ export {
|
||||||
removeAccents,
|
removeAccents,
|
||||||
hasAccents,
|
hasAccents,
|
||||||
getEnglishWord,
|
getEnglishWord,
|
||||||
|
getVerbBlockPosFromPerson,
|
||||||
// protobuf helpers
|
// protobuf helpers
|
||||||
readDictionary,
|
readDictionary,
|
||||||
writeDictionary,
|
writeDictionary,
|
||||||
|
|
Loading…
Reference in New Issue