From 6d6319e0624b09f45a351544924e1e532f85bae3 Mon Sep 17 00:00:00 2001 From: adueck Date: Fri, 23 Sep 2022 12:37:17 +0400 Subject: [PATCH] remove regular/irregular option --- package.json | 2 +- src/App.tsx | 26 +------------------------- 2 files changed, 2 insertions(+), 26 deletions(-) diff --git a/package.json b/package.json index d5a4aad..a0038c0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lingdocs/pashto-inflector", - "version": "3.9.6", + "version": "3.9.7", "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/App.tsx b/src/App.tsx index c957139..5506d62 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -64,7 +64,6 @@ const allVerbs = verbs.map((v: { entry: T.DictionaryEntry, complement?: T.Dictio function App() { const [verbTs, setVerbTs] = useStickyState(0, "verbTs1"); const [verbTypeShowing, setVerbTypeShowing] = useStickyState("simple", "vTypeShowing"); - const [regularIrregular, setRegularIrregular] = useStickyState<"regular" | "irregular">("regular", "regIrreg"); const [transitivityShowing, setTransitivityShowing] = useStickyState("intransitive", "transitivityShowing1"); const [showingTextOptions, setShowingTextOptions] = useStickyState(false, "showTextOpts1"); const [textOptions, setTextOptions] = useStickyState(defualtTextOptions, "textOpts1"); @@ -106,9 +105,6 @@ function App() { } setTransitivityShowing(e.target.value as T.Transitivity); } - const isRegularVerb = (entry: T.DictionaryEntry): boolean => ( - !entry.l && !entry.psp && !entry.ssp && !entry.prp && !entry.pprtp && !entry.noOo && !entry.sepOo - ); const verbsAvailable = allVerbs.filter((verb) => ( ( (verb.info.type === "transitive or grammatically transitive simple" && verbTypeShowing === "simple") && (transitivityShowing === "transitive" || transitivityShowing === "grammatically transitive") @@ -123,14 +119,7 @@ function App() { && ( transitivityShowing === verb.info.transitivity )) - )).filter((verb) => { - if (verbTypeShowing !== "simple") { - return true; - } - return regularIrregular === "regular" - ? isRegularVerb(verb.verb.entry) - : !isRegularVerb(verb.verb.entry); - }).sort((a, b) => a.verb.entry.p.localeCompare(b.verb.entry.p, "ps")); + )).sort((a, b) => a.verb.entry.p.localeCompare(b.verb.entry.p, "ps")); const v = (() => { const vFound = verbsAvailable.find(v => v.verb.entry.ts === verbTs); @@ -237,19 +226,6 @@ function App() { ))} - {verbTypeShowing === "simple" && -
- -
- }
Transitivity:
{transitivities.map((transitivity) => (