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", "name": "@lingdocs/pashto-inflector",
"version": "3.8.7", "version": "3.8.8",
"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

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

View File

@ -27,6 +27,14 @@ export function noPersInfs(s:
return 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 { export function pickPersInf<T>(s: T.OptionalPersonInflections<T>, persInf: T.PersonInflectionsField): T {
if ("mascSing" in s) { if ("mascSing" in s) {
return s[persInf]; return s[persInf];

View File

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