From b6ebdd66ca0c2979f61a3705aefcb268f66fd8a0 Mon Sep 17 00:00:00 2001 From: lingdocs <71590811+lingdocs@users.noreply.github.com> Date: Tue, 26 Apr 2022 12:11:46 +0500 Subject: [PATCH] big improvements and equative explorer/machine working! --- nouns-adjs/loc-adverbs.js | 53 +++++ nouns-adjs/u-masc.js | 1 - package.json | 2 +- src/App.tsx | 17 +- src/components/EntrySelect.tsx | 21 +- src/components/ep-explorer/EPDisplay.tsx | 85 +++++++ src/components/ep-explorer/EPExplorer.tsx | 213 ++++++++++++++++++ .../ep-explorer/EqChartsDisplay.tsx | 24 ++ src/components/ep-explorer/EquativePicker.tsx | 107 +++++++++ .../eq-comp-picker/EqCompPicker.tsx | 77 +++++++ .../eq-comp-picker/LocativeAdverbPicker.tsx | 37 +++ src/components/np-picker/AdjectivePicker.tsx | 37 +++ src/components/np-picker/NPNounPicker.tsx | 15 +- .../np-picker/NPParticiplePicker.tsx | 15 +- src/components/np-picker/NPPicker.tsx | 33 +-- src/components/np-picker/NPPronounPicker.tsx | 3 +- .../vp-explorer/AbbreviationFormSelector.tsx | 4 +- src/components/vp-explorer/TensePicker.tsx | 6 +- .../{ChartDisplay.tsx => VPChartDisplay.tsx} | 0 src/components/vp-explorer/VPDisplay.tsx | 4 +- src/components/vp-explorer/VPExplorer.tsx | 41 +--- src/components/vp-explorer/VPExplorerQuiz.tsx | 6 +- src/components/vp-explorer/VerbPicker.tsx | 4 +- src/components/vp-explorer/verb-selection.ts | 4 +- src/lib/accent-helpers.ts | 8 +- src/lib/misc-helpers.ts | 8 +- src/lib/pashto-inflector.test.ts | 18 ++ src/lib/pashto-inflector.ts | 6 +- src/lib/phrase-building/compile-ep.ts | 89 ++++++++ src/lib/phrase-building/compile-vp.ts | 110 +-------- src/lib/phrase-building/render-ep.ts | 163 ++++++++++++++ src/lib/phrase-building/render-np.ts | 125 ++++++++++ src/lib/phrase-building/render-vp.ts | 119 +--------- src/lib/phrase-building/segment.ts | 110 +++++++++ src/lib/phrase-building/vp-tools.ts | 8 +- src/lib/type-predicates.ts | 4 +- src/library.ts | 2 + src/nouns-adjs.ts | 2 +- src/types.ts | 80 ++++++- 39 files changed, 1310 insertions(+), 351 deletions(-) create mode 100644 nouns-adjs/loc-adverbs.js create mode 100644 src/components/ep-explorer/EPDisplay.tsx create mode 100644 src/components/ep-explorer/EPExplorer.tsx create mode 100644 src/components/ep-explorer/EqChartsDisplay.tsx create mode 100644 src/components/ep-explorer/EquativePicker.tsx create mode 100644 src/components/ep-explorer/eq-comp-picker/EqCompPicker.tsx create mode 100644 src/components/ep-explorer/eq-comp-picker/LocativeAdverbPicker.tsx create mode 100644 src/components/np-picker/AdjectivePicker.tsx rename src/components/vp-explorer/{ChartDisplay.tsx => VPChartDisplay.tsx} (100%) create mode 100644 src/lib/phrase-building/compile-ep.ts create mode 100644 src/lib/phrase-building/render-ep.ts create mode 100644 src/lib/phrase-building/render-np.ts create mode 100644 src/lib/phrase-building/segment.ts diff --git a/nouns-adjs/loc-adverbs.js b/nouns-adjs/loc-adverbs.js new file mode 100644 index 0000000..da1a7ef --- /dev/null +++ b/nouns-adjs/loc-adverbs.js @@ -0,0 +1,53 @@ +module.exports = [ + { ts: 1527822780, e: `forward, towards` }, // ورمخته - wărmukhta + { ts: 1527820292, e: `behind` }, // شاته - shaata + { ts: 1527814912, e: `near, close to` }, // رانږدې - raanaGde + { ts: 1527813928, e: `right here, in this very place` }, // همدلته - hamdalta + { ts: 1610454983695, e: `at this place, at that place, here` }, // دغلته - daghalta + { ts: 1527813279, e: `in front of, forward, ahead of` }, // مخته - mukhta + { ts: 1527822042, e: `above, overhead` }, // راپورته - raaporta + { ts: 1588758935200, e: `that way, direction, over there` }, // وراخوا - wăraakhwaa + { ts: 1527817302, e: `together, in one place` }, // یوځای - yodzaay + { ts: 1527812558, e: `here` }, // دلته - dălta + { ts: 1527814911, e: `near, close to, almost` }, // نږدې - naGde + { ts: 1578080952673, e: `outside, outside of, beyond` }, // دباندې - dubaande + { ts: 1527812780, e: `down, beneath` }, // ښکته - xkuta + { ts: 1527813688, e: `lower, below, down` }, // کوز - kooz + { ts: 1610796256372, e: `forward` }, // مخ په وړاندې - mukh pu wRaande + { ts: 1527812293, e: `with you` }, // درسره - dărsara + { ts: 1527812935, e: `face to face, across from, opposite; straight` }, // مخامخ - mukhaamukh + { ts: 1527815420, e: `later, after, behind` }, // وروسته - wroosta + { ts: 1527811221, e: `above, overhead` }, // پورته - porta + { ts: 1527813690, e: `above, on top` }, // بر - bar + { ts: 1527822803, e: `far, distantly, a bit further, to the side, back, away, direction` }, // هیسته - héesta + { ts: 1579824262965, e: `together, in one place; at the same time` }, // یو ځای - yo dzaay + { ts: 1527814913, e: `near, close to` }, // ورنږدې - warnaGde + { ts: 1527814318, e: `in front, forward, before` }, // مخکښې - mukhkxe + { ts: 1527812413, e: `after oneself` }, // راپسې - raapase + { ts: 1527822852, e: `this way and that way, here and there` }, // دېخوا هاخوا - dekhwaa haakhwaa + { ts: 1527812449, e: `there` }, // هلته - hálta, álta + { ts: 1610796249240, e: `forward` }, // مخ پر وړاندې - mukh pur wRaande + { ts: 1527819393, e: `over/across to you/there` }, // درپورې - darpore + { ts: 1527821253, e: `near, close (نژدې)` }, // نزدې - nizde, nazde + { ts: 1527813122, e: `inside, within, interior` }, // دننه - dununa + { ts: 1527817710, e: `that side, across` }, // ها خوا - haakhwaa + { ts: 1581189430959, e: `ahead, in front; earlier, first, before` }, // پېش - pesh + { ts: 1527823145, e: `outside, from without, on the outside; abroad (as in out of country)` }, // بېرون - beróon + { ts: 1527814605, e: `far, distant` }, // لرې - lure + { ts: 1527819438, e: `far, distant, removed` }, // لېرې - lere + { ts: 1578015603537, e: `above` }, // له پاسه - la paasa + { ts: 1588780597931, e: `near, close to, almost` }, // نېږدې - neGdé + { ts: 1527814708, e: `close, near, soon, almost` }, // نژدې - nijzde, najzde + { ts: 1594909066356, e: `around, in the area` }, // خوا و شا - khwaa-U-shaa + { ts: 1577999518050, e: `there, over there, thither` }, // هورې - hooré + { ts: 1527815416, e: `ahead, forward, before, earlier` }, // وړاندې - wRaande + { ts: 1527818064, e: `after him/her/it/them, behind` }, // ورپسې - warpase + { ts: 1527818186, e: `after you (sing and plural)` }, // درپسې - dărpase + { ts: 1527818069, e: `in front of him/her/it/them` }, // وروړاندې - wărwRaande + { ts: 1527819321, e: `down, below; slope` }, // کښته - kxúta + { ts: 1527820805, e: `right there, in the same place, in the very same place` }, // هماغلته - hamáaghalta + { ts: 1527815457, e: `all over, throughout` }, // سراسري - săraasaree + { ts: 1527819388, e: `inside, in` }, // وردننه - wardunúna + { ts: 1527812375, e: `back (as in return)` }, // واپس - waapus + { ts: 1527817294, e: `up, above` }, // پاس - paas +]; \ No newline at end of file diff --git a/nouns-adjs/u-masc.js b/nouns-adjs/u-masc.js index 9e785ab..c76df6b 100644 --- a/nouns-adjs/u-masc.js +++ b/nouns-adjs/u-masc.js @@ -5,7 +5,6 @@ module.exports = [ { ts: 1588857967561, e: `bull` }, // غوایه - ghwaayú { ts: 1527817108, e: `look, gaze, examination, inspection, spying` }, // کاته - kaatu { ts: 1527817768, e: `raven, crow` }, // کارګه - kaargu - { ts: 1527819245, e: `master of house, head of family, married man` }, // کوربانه - korbaanú { ts: 1527818516, e: `swimming, bathing` }, // لمبېده - lambedú { ts: 1527813986, e: `sunset, west` }, // لمر پرېواته - lmarprewaatu { ts: 1527813992, e: `sunset` }, // لمر لوېده - lmarlwedu diff --git a/package.json b/package.json index f828c44..1a46eb6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lingdocs/pashto-inflector", - "version": "2.2.0", + "version": "2.3.0", "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 b9690f8..f3b9d6d 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -23,7 +23,7 @@ import { Modal } from "react-bootstrap"; import * as T from "./types"; -import { isNounEntry } from "./lib/type-predicates"; +import { isAdjectiveEntry, isLocativeAdverbEntry, isNounEntry } from "./lib/type-predicates"; import defualtTextOptions from "./lib/default-text-options"; import PhraseBuilder from "./components/vp-explorer/VPExplorer"; import useStickyState from "./lib/useStickyState"; @@ -35,6 +35,14 @@ const verbTypes: VerbType[] = [ ]; const nouns = nounsAdjs.filter(isNounEntry); +const adjectives = nounsAdjs.filter(isAdjectiveEntry); +const locativeAdverbs = nounsAdjs.filter(isLocativeAdverbEntry); +const entryFeeder: T.EntryFeeder = { + locativeAdverbs, + nouns, + adjectives, + verbs, +}; const transitivities: T.Transitivity[] = [ "transitive", @@ -47,6 +55,8 @@ const allVerbs = verbs.map((v: { entry: T.DictionaryEntry, complement?: T.Dictio info: getVerbInfo(v.entry, v.complement), })); + + function App() { const [verbTs, setVerbTs] = useStickyState(0, "verbTs1"); const [verbTypeShowing, setVerbTypeShowing] = useStickyState("simple", "vTypeShowing"); @@ -215,6 +225,7 @@ function App() { name="verb-type" checked={verbTypeShowing === type} value={type} + onChange={() => null} />