just show roots and stems for aux verb on dynamic compound

This commit is contained in:
lingdocs 2022-09-02 14:00:24 +04:00
parent 05a8cae945
commit 70de3344a7
4 changed files with 15 additions and 2 deletions

View File

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

View File

@ -8,6 +8,7 @@ import CompoundDisplay from "./CompoundDisplay";
import {
VpsReducerAction
} from "./vps-reducer";
import { ensureNonComboVerbInfo } from "../../lib/misc-helpers";
// TODO: dark on past tense selecitons
@ -68,7 +69,7 @@ function VerbPicker(props: {
{info && <div className="mt-3 mb-1 text-center">
<Hider
showing={showRootsAndStems}
label={`🌳 ${passiveRootsAndStems ? "Passive" : abilityRootsAndStems ? "Ability" : ""} Roots and Stems`}
label={`🌳 ${passiveRootsAndStems ? "Passive" : abilityRootsAndStems ? "Ability" : ""} Roots and Stems${info.type === "dynamic compound" ? " for Aux. Verb" : ""}`}
handleChange={() => setShowRootsAndStems(p => !p)}
hLevel={5}
>
@ -78,6 +79,8 @@ function VerbPicker(props: {
? passiveRootsAndStems
: abilityRootsAndStems
? abilityRootsAndStems
: info.type === "dynamic compound"
? ensureNonComboVerbInfo(getVerbInfo(info.auxVerb))
: info}
/>
</Hider>

View File

@ -27,6 +27,14 @@ export function noPersInfs(s:
return s;
}
export function ensureNonComboVerbInfo(i: T.VerbInfo): T.NonComboVerbInfo {
return "stative" in i
? i.stative
: "transitive" in i
? i.transitive
: i;
}
export function pickPersInf<T>(s: T.OptionalPersonInflections<T>, persInf: T.PersonInflectionsField): T {
if ("mascSing" in s) {
return s[persInf];

View File

@ -121,6 +121,7 @@ import {
isThirdPerson,
blank,
kidsBlank,
ensureNonComboVerbInfo,
} from "./lib/misc-helpers";
import {
simplifyPhonetics,
@ -252,6 +253,7 @@ export {
getEnglishVerb,
humanReadableVerbForm,
humanReadableEquativeTense,
ensureNonComboVerbInfo,
roleIcon,
vpsReducer,
makeVPSelectionState,