From 70de3344a7b2c963d5df3c854ec293549a55225b Mon Sep 17 00:00:00 2001 From: lingdocs <71590811+lingdocs@users.noreply.github.com> Date: Fri, 2 Sep 2022 14:00:24 +0400 Subject: [PATCH] just show roots and stems for aux verb on dynamic compound --- package.json | 2 +- src/components/vp-explorer/VerbPicker.tsx | 5 ++++- src/lib/misc-helpers.ts | 8 ++++++++ src/library.ts | 2 ++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index d8d0fc5..18c822d 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/components/vp-explorer/VerbPicker.tsx b/src/components/vp-explorer/VerbPicker.tsx index 0903a5b..0e5ecd5 100644 --- a/src/components/vp-explorer/VerbPicker.tsx +++ b/src/components/vp-explorer/VerbPicker.tsx @@ -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 &&
setShowRootsAndStems(p => !p)} hLevel={5} > @@ -78,6 +79,8 @@ function VerbPicker(props: { ? passiveRootsAndStems : abilityRootsAndStems ? abilityRootsAndStems + : info.type === "dynamic compound" + ? ensureNonComboVerbInfo(getVerbInfo(info.auxVerb)) : info} /> diff --git a/src/lib/misc-helpers.ts b/src/lib/misc-helpers.ts index 3cd7035..c2dba07 100644 --- a/src/lib/misc-helpers.ts +++ b/src/lib/misc-helpers.ts @@ -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(s: T.OptionalPersonInflections, persInf: T.PersonInflectionsField): T { if ("mascSing" in s) { return s[persInf]; diff --git a/src/library.ts b/src/library.ts index ac5704b..97f1139 100644 --- a/src/library.ts +++ b/src/library.ts @@ -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,