/** * Copyright (c) 2021 lingdocs.com * * This source code is licensed under the GPL3 license found in the * LICENSE file in the root directory of this source tree. * */ import { useEffect, useState } from "react"; import ButtonSelect from "./components/src/ButtonSelect"; import { Modal } from "react-bootstrap"; import * as T from "./types"; import defualtTextOptions from "./lib/src/default-text-options"; import useStickyState from "./components/src/useStickyState"; import EPExplorer from "./components/src/ep-explorer/EPExplorer"; import VPBuilderDemo from "./demo-components/VPBuilderDemo"; import { entryFeeder } from "./demo-components/entryFeeder"; import { Hider } from "./components/library"; import InflectionDemo from "./demo-components/InflectionDemo"; import SpellingDemo from "./demo-components/SpellingDemo"; import { renderVerb } from "./lib/src/render-verb"; function App() { const [showingTextOptions, setShowingTextOptions] = useStickyState(false, "showTextOpts1"); const [textOptions, setTextOptions] = useStickyState(defualtTextOptions, "textOpts1"); const [theme, setTheme] = useStickyState<"light" | "dark">("light", "theme1"); const [showing, setShowing] = useState(""); function handleHiderClick(label: string) { setShowing(os => os === label ? "" : label); } useEffect(() => { document.documentElement.setAttribute("data-theme", theme); }, [theme]); const rv = renderVerb({ verb: { entry: {"ts":1527815399,"i":15035,"p":"وهل","f":"wahul","g":"wahul","e":"to hit","r":4,"c":"v. trans.","tppp":"واهه","tppf":"waahu","ec":"hit,hits,hitting,hit,hit"} as T.VerbDictionaryEntry}, aspect: "imperfective", tense: "habitualPast", person: 9, }); return <>
                {JSON.stringify(rv, null, "  ")}
            
setTheme(theme === "light" ? "dark" : "light")} >
setShowingTextOptions(true)} >

Pashto Inflector

An open source TypeScript/React library for Pashto inflection, verb conjugation, phrase generation, text conversion, and more

Used in the LingDocs Pashto Dictionary and LingDocs Pashto Grammar

by Adam Dueck - GPLv3 licensed Source Code on GitHub

Demos:

handleHiderClick("verbs")} > handleHiderClick("equatives")} >
handleHiderClick("inflection")} > handleHiderClick("spelling")} >
setShowingTextOptions(false)}> Settings
Pashto Spelling
{ setTextOptions({ ...textOptions, spelling: p, }); }} />
Diacritics
setTextOptions({ ...textOptions, diacritics: p === "true" })} />
Pashto Text Size
setTextOptions({ ...textOptions, pTextSize: p })} />
Phonetics
setTextOptions({ ...textOptions, phonetics: p })} />
{/* */} } export default App;