From bfdc95f774724701c1a29e913fe47221e66ac6f8 Mon Sep 17 00:00:00 2001 From: lingdocs <71590811+lingdocs@users.noreply.github.com> Date: Sat, 9 Apr 2022 18:24:01 +0500 Subject: [PATCH] oops --- package.json | 2 +- src/components/np-picker/picker-tools.tsx | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 5f3409d..c416714 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lingdocs/pashto-inflector", - "version": "1.8.3", + "version": "1.8.4", "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/np-picker/picker-tools.tsx b/src/components/np-picker/picker-tools.tsx index 47fec06..eaf72d0 100644 --- a/src/components/np-picker/picker-tools.tsx +++ b/src/components/np-picker/picker-tools.tsx @@ -29,7 +29,8 @@ export const zIndexProps = { }; export function makeVerbSelectOption(e: T.VerbEntry, opts: T.TextOptions): { value: string, label: string | JSX.Element } { - const eng = getEnglishVerb(e.entry); + const engV = getEnglishVerb(e.entry); + const eng = engV || truncateEnglish(e.entry.e); const ps = plainTextPsAdjustment( { p: e.entry.p, f: removeFVarients(e.entry.f) }, opts, @@ -62,16 +63,17 @@ function plainTextPsAdjustment(ps: T.PsString, opts: T.TextOptions): T.PsString return { p: getP(ps), f: getF(ps.f) }; } +function truncateEnglish(s: string): string { + const maxLength = 16; + return s.length <= maxLength + ? s + : s.slice(0, maxLength) + "…"; +} + export function makeSelectOption( e: T.DictionaryEntry | T.VerbEntry | T.NounEntry | T.AdjectiveEntry | T.LocativeAdverbEntry, opts: T.TextOptions, ): { value: string, label: string } { - function truncateEnglish(s: string) { - const maxLength = 16; - return s.length <= maxLength - ? maxLength - : s.slice(0, maxLength) + "…"; - } const entry = "entry" in e ? e.entry : e; const eng = (() => { try {