From a909ff533f435119bbabdcc05668f1d185244bfc Mon Sep 17 00:00:00 2001 From: lingdocs <71590811+lingdocs@users.noreply.github.com> Date: Tue, 20 Jul 2021 15:41:55 +0300 Subject: [PATCH] Two bug fixes: 1. Don't show sentence forms when the conjugation viewer is limited to forms that don't have sentence capability 2. Fixed English conjugation of "they ~sees~ see" etc. --- package.json | 2 +- src/App.tsx | 20 -------------------- src/components/ConjugationViewer.tsx | 11 ++++++----- src/lib/conjugation-forms.tsx | 9 ++++++++- 4 files changed, 15 insertions(+), 27 deletions(-) diff --git a/package.json b/package.json index 3d2c84c..11e7668 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lingdocs/pashto-inflector", - "version": "0.8.1", + "version": "0.8.2", "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 de04bee..532764b 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -11,7 +11,6 @@ import ConjugationViewer from "./components/ConjugationViewer"; import verbs from "./verbs"; import Pashto from "./components/Pashto"; import Phonetics from "./components/Phonetics"; -import InlinePs from "./components/InlinePs"; import { getVerbInfo } from "./lib/verb-info"; import ButtonSelect from "./components/ButtonSelect"; import { @@ -51,7 +50,6 @@ function App() { const [transitivityShowing, setTransitivityShowing] = useState("intransitive"); const [showingTextOptions, setShowingTextOptions] = useState(false); const [textOptions, setTextOptions] = useState(defualtTextOptions); - const [aayTailType, setAayTailType] = useState("aay"); const [theme, setTheme] = useState<"light" | "dark">("light"); // const onlyGrammTrans = (arr: Transitivity[]) => ( // arr.length === 1 && arr[0] === "grammatically transitive" @@ -69,7 +67,6 @@ function App() { const transitivitiyShowing = localStorage.getItem("transitivityShowing") as undefined | T.Transitivity; const theme = localStorage.getItem("theme"); const textOptionst = localStorage.getItem("textOptions"); - const aayTailType = localStorage.getItem("aayType"); if (regularIrregular) { setRegularIrregular(regularIrregular); } @@ -91,9 +88,6 @@ function App() { if (textOptionst) { setTextOptions(JSON.parse(textOptionst) as T.TextOptions); } - if (aayTailType) { - setAayTailType(aayTailType as T.AayTail); - } }, []); useEffect(() => { @@ -103,7 +97,6 @@ function App() { localStorage.setItem("transitivityShowing", transitivityShowing); localStorage.setItem("textOptions", JSON.stringify(textOptions)); localStorage.setItem("theme", theme); - localStorage.setItem("aayType", aayTailType); }); useEffect(() => { @@ -301,7 +294,6 @@ function App() { entry={v?.verb.entry} complement={v?.verb.complement} textOptions={textOptions} - showOnly={["Perfective Future"]} />} @@ -322,20 +314,8 @@ function App() { ...textOptions, spelling: p as "Afghan" | "Pakistani", }); - if (p === "Pakistani") setAayTailType("ey"); }} /> - {textOptions.spelling !== "Pakistani" && <> -
Non-Inflecting Tail Spelling
- {{ p: "ی", f: "ey" }}, value: "ey" }, - { label: {{ p: "ای", f: "aay" }}, value: "aay" }, - ]} - value={aayTailType} - handleChange={(p) => setAayTailType(p as "ey" | "aay")} - /> - }
Diacritics
"sentence" in form); return
{"transitive" in conjugation &&
@@ -305,7 +306,7 @@ function ConjugationViewer({ entry, complement, textOptions, showOnly, highlight hideTypeInfo={!!limitTo} />
-
+ {sentencesAvailable &&
dispatch({ type: "setMode", payload: p as "chart" | "sentence" })} /> -
+
} {!limitTo && <>
}
- {state.mode === "sentence" && + {(state.mode === "sentence" && sentencesAvailable) &&
dispatch({ type: "set forms opened", payload })} verbConj={verbConj} textOptions={textOptions} diff --git a/src/lib/conjugation-forms.tsx b/src/lib/conjugation-forms.tsx index 085e1d6..9e6cad2 100644 --- a/src/lib/conjugation-forms.tsx +++ b/src/lib/conjugation-forms.tsx @@ -683,8 +683,15 @@ function isThirdPerson(p: T.Person): boolean { ); } +function isThirdPersonSing(p: T.Person): boolean { + return ( + p === T.Person.ThirdSingMale || + p === T.Person.ThirdSingFemale + ); +} + function engPresC(s: T.Person, ec: T.EnglishVerbConjugationEc | [string, string]): string { - return isThirdPerson(s) ? ec[1] : ec[0]; + return isThirdPersonSing(s) ? ec[1] : ec[0]; } function engEquative(tense: "past" | "present", s: T.Person): string {