fix accent on passive roots and stems - unfortunately just for the verb info display for now

This commit is contained in:
lingdocs 2022-07-26 16:08:03 -05:00
parent e733e55e2b
commit de13db2e5b
2 changed files with 19 additions and 7 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@lingdocs/pashto-inflector", "name": "@lingdocs/pashto-inflector",
"version": "3.5.5", "version": "3.5.6",
"author": "lingdocs.com", "author": "lingdocs.com",
"description": "A Pashto inflection and verb conjugation engine, inculding React components for displaying Pashto text, inflections, and conjugations", "description": "A Pashto inflection and verb conjugation engine, inculding React components for displaying Pashto text, inflections, and conjugations",
"homepage": "https://verbs.lingdocs.com", "homepage": "https://verbs.lingdocs.com",

View File

@ -983,7 +983,6 @@ function makeDynamicPerfectiveSplit(comp: T.PsString, auxSplit: T.SplitInfo): T.
} }
export function getPassiveRootsAndStems(info: T.NonComboVerbInfo, withTails?: boolean): T.PassiveRootsStems | undefined { export function getPassiveRootsAndStems(info: T.NonComboVerbInfo, withTails?: boolean): T.PassiveRootsStems | undefined {
console.log({ withTails });
if (info.transitivity === "intransitive") return undefined; if (info.transitivity === "intransitive") return undefined;
return { return {
stem: getPassiveStem(info.root, info.root.perfectiveSplit, withTails), stem: getPassiveStem(info.root, info.root.perfectiveSplit, withTails),
@ -1074,7 +1073,7 @@ function getPassivePastParticiple(root: T.OptionalPersonInflections<T.LengthOpti
} }
const r = withTails ? concatPsString(root, passiveRootTail) : root; const r = withTails ? concatPsString(root, passiveRootTail) : root;
// @ts-ignore // @ts-ignore
return concatPsString(getLong(r), " ", stativeAux.intransitive.info.participle.past) as T.PsString; return concatPsString(removeAccents(getLong(r)), " ", stativeAux.intransitive.info.participle.past) as T.PsString;
} }
function getPassiveStemAspect(root: T.FullForm<T.PsString>, aspect: T.Aspect): T.FullForm<T.PsString> { function getPassiveStemAspect(root: T.FullForm<T.PsString>, aspect: T.Aspect): T.FullForm<T.PsString> {
@ -1086,7 +1085,11 @@ function getPassiveStemAspect(root: T.FullForm<T.PsString>, aspect: T.Aspect): T
"femPlur": getPassiveStemAspect(root.femPlur, aspect) as T.PsString, "femPlur": getPassiveStemAspect(root.femPlur, aspect) as T.PsString,
}; };
} }
return concatPsString(getLong(root), " ", stativeAux.intransitive.info.stem[aspect]); return concatPsString(
aspect === "perfective" ? removeAccents(getLong(root)) : getLong(root),
" ",
stativeAux.intransitive.info.stem[aspect],
);
} }
function getPassiveRootAspect(root: T.OptionalPersonInflections<T.LengthOptions<T.PsString>>, aspect: T.Aspect): T.OptionalPersonInflections<T.LengthOptions<T.PsString>> { function getPassiveRootAspect(root: T.OptionalPersonInflections<T.LengthOptions<T.PsString>>, aspect: T.Aspect): T.OptionalPersonInflections<T.LengthOptions<T.PsString>> {
@ -1099,9 +1102,18 @@ function getPassiveRootAspect(root: T.OptionalPersonInflections<T.LengthOptions<
}; };
} }
return { return {
long: concatPsString(
root.long,
" ",
// @ts-ignore
aspect === "perfective" ? removeAccents(stativeAux.intransitive.info.root[aspect].long) : removeAccents(stativeAux.intransitive.info.root[aspect].long),
),
// @ts-ignore // @ts-ignore
long: concatPsString(root.long, " ", stativeAux.intransitive.info.root[aspect].long), short: concatPsString(
// @ts-ignore root.long,
short: concatPsString(root.long, " ", stativeAux.intransitive.info.root[aspect].short), " ",
// @ts-ignore
aspect === "perfective" ? removeAccents(stativeAux.intransitive.info.root[aspect].short) : removeAccents(stativeAux.intransitive.info.root[aspect].short),
),
} }
} }