more verb games
This commit is contained in:
parent
ae0d1d1fdb
commit
6344b59034
|
@ -7,7 +7,7 @@
|
||||||
"@formkit/auto-animate": "^1.0.0-beta.1",
|
"@formkit/auto-animate": "^1.0.0-beta.1",
|
||||||
"@fortawesome/fontawesome-free": "^5.15.4",
|
"@fortawesome/fontawesome-free": "^5.15.4",
|
||||||
"@lingdocs/lingdocs-main": "^0.3.3",
|
"@lingdocs/lingdocs-main": "^0.3.3",
|
||||||
"@lingdocs/pashto-inflector": "^3.8.8",
|
"@lingdocs/pashto-inflector": "^3.8.9",
|
||||||
"@testing-library/jest-dom": "^5.11.4",
|
"@testing-library/jest-dom": "^5.11.4",
|
||||||
"@testing-library/react": "^11.1.0",
|
"@testing-library/react": "^11.1.0",
|
||||||
"@testing-library/user-event": "^12.1.10",
|
"@testing-library/user-event": "^12.1.10",
|
||||||
|
|
|
@ -1,26 +1,28 @@
|
||||||
import {
|
import {
|
||||||
Types as T,
|
Types as T,
|
||||||
} from "@lingdocs/pashto-inflector";
|
} from "@lingdocs/pashto-inflector";
|
||||||
|
import { wordQuery } from "../../words/words";
|
||||||
|
|
||||||
// @ts-ignore
|
export const basicVerbs: T.VerbEntry[] = wordQuery("verbs", [
|
||||||
export const basicVerbs: T.VerbEntry[] = [
|
"leekul",
|
||||||
{"ts":1527812856,"i":11630,"p":"لیکل","f":"leekul","g":"leekul","e":"to write, draw","c":"v. trans./gramm. trans.","ec":"write,writes,writing,wrote,written"},
|
"wahul",
|
||||||
{"ts":1527815399,"i":14480,"p":"وهل","f":"wahul","g":"wahul","e":"to hit","c":"v. trans.","tppp":"واهه","tppf":"waahu","ec":"hit,hits,hitting,hit,hit"},
|
"skul",
|
||||||
{"ts":1527817750,"i":7843,"p":"سکل","f":"skul","g":"skul","e":"to drink","c":"v. trans.","ec":"drink,drinks,drinking,drank,drank"},
|
"kawul",
|
||||||
{"ts":1527812752,"i":10625,"p":"کول","f":"kawul","g":"kawul","e":"to do (an action or activity)","c":"v. trans. irreg.","ssp":"وکړ","ssf":"óokR","prp":"وکړل","prf":"óokRul","pprtp":"کړی","pprtf":"kúRey","diacExcept":true,"ec":"do,does,doing,did,done"},
|
"leedul",
|
||||||
{"ts":1527812275,"i":11608,"p":"لیدل","f":"leedul","g":"leedul","e":"to see","c":"v. trans./gramm. trans.","psp":"وین","psf":"ween","tppp":"لید","tppf":"leed","ec":"see,sees,seeing,saw,seen"},
|
"awredul",
|
||||||
{"ts":1577049208257,"i":1068,"p":"اورېدل","f":"awredul","g":"awredul","e":"to hear, listen","c":"v. trans./gramm. trans.","psp":"اور","psf":"awr","tppp":"اورېد","tppf":"awred","ec":"hear,hears,hearing,heard"},
|
"khoRul",
|
||||||
{"ts":1527812790,"i":5795,"p":"خوړل","f":"khoRul","g":"khoRul","e":"to eat, to bite","c":"v. trans.","psp":"خور","psf":"khor","tppp":"خوړ","tppf":"khoR","ec":"eat,eats,eating,ate,eaten"},
|
]);
|
||||||
].map(entry => ({ entry }));
|
|
||||||
|
|
||||||
// @ts-ignore
|
export const intransitivePastVerbs: T.VerbEntry[] = wordQuery("verbs", [
|
||||||
export const intransitivePastVerbs: T.VerbEntry[] = [
|
"rasedul",
|
||||||
{"ts":1527813573,"i":6809,"p":"رسېدل","f":"rasedul","g":"rasedul","e":"arrive, reached; (fig.) understand, attain to; mature, ripen","c":"v. intrans.","shortIntrans":true,"ec":"arrive"},
|
"gurdzedul",
|
||||||
{"ts":1527812645,"i":10822,"p":"ګرځېدل","f":"gurdzedul","g":"gurdzedul","e":"to walk, wander, turn about; to become, to be","c":"v. intrans.","shortIntrans":true,"ec":"walk"},
|
"tuxtedul",
|
||||||
{"ts":1527816495,"i":3470,"p":"تښتېدل","f":"tuxtedul","g":"tuxtedul","e":"to run off, escape, flee","c":"v. intrans.","shortIntrans":true,"ec":"escape"},
|
"ghuGedul",
|
||||||
{"ts":1527813680,"i":9218,"p":"غږېدل","f":"ghuGedul, ghaGedul","g":"ghugedul,ghagedul","e":"to speak, talk, converse, sing","c":"v. intrans.","ec":"speak,speaks,speaking,spoke"},
|
"lwedul",
|
||||||
{"ts":1527813994,"i":11676,"p":"لوېدل","f":"lwedul","g":"lwedul","e":"to fall, to tumble, go down, settle","c":"v. intrans.","tppp":"لوېد","tppf":"lwed","ec":"fall,falls,falling,fell,fallen"},
|
"raatlúl",
|
||||||
{"ts":1527815216,"i":6630,"p":"راتلل","f":"raatlúl","g":"raatlul","e":"to come","c":"v. intrans. irreg.","psp":"راځ","psf":"raadz","ssp":"راش","ssf":"ráash","prp":"راغلل","prf":"ráaghlul","pprtp":"راغلی","pprtf":"raaghúley","tppp":"راغی","tppf":"ráaghey","noOo":true,"separationAtP":2,"separationAtF":3,"ec":"come,comes,coming,came,come"},
|
"zeGedul",
|
||||||
{"ts":1527813710,"i":7321,"p":"زېږېدل","f":"zeGedul","g":"zegedul","e":"to be born, to appear, arise","c":"v. intrans.","ec":"be","ep":"born"},
|
"kenaastul",
|
||||||
{"ts":1527812759,"i":10796,"p":"کېناستل","f":"kenaastul","g":"kenaastul","e":"to sit down, to have a seat","c":"v. intrans. irreg.","psp":"کېن","psf":"ken","noOo":true,"separationAtP":2,"separationAtF":2,"ec":"sit,sits,sitting,sat","ep":"down"},
|
"alwatul",
|
||||||
].map(entry => ({ entry }));
|
"prewatul",
|
||||||
|
"خوځېدل",
|
||||||
|
]);
|
|
@ -29,6 +29,8 @@ import {
|
||||||
transitiveImperfectivePastVerbGame2,
|
transitiveImperfectivePastVerbGame2,
|
||||||
transitivePerfectivePastVerbGame1,
|
transitivePerfectivePastVerbGame1,
|
||||||
transitivePerfectivePastVerbGame2,
|
transitivePerfectivePastVerbGame2,
|
||||||
|
habitualPastVerbGame1,
|
||||||
|
habitualPastVerbGame2,
|
||||||
} from "../../games/games";
|
} from "../../games/games";
|
||||||
import GameDisplay from "../../games/GameDisplay";
|
import GameDisplay from "../../games/GameDisplay";
|
||||||
|
|
||||||
|
@ -239,4 +241,8 @@ The habitual continuous past is **also used to say what would happen if some con
|
||||||
{ p: "**که زه ستړې نه وای، **پارک ته به تلم", f: "ku zu stuRe nu waay, **paark ta ba tlum**", e: "If I (f.) wasn't tired, **I would go to the park**." }
|
{ p: "**که زه ستړې نه وای، **پارک ته به تلم", f: "ku zu stuRe nu waay, **paark ta ba tlum**", e: "If I (f.) wasn't tired, **I would go to the park**." }
|
||||||
])}</Examples>
|
])}</Examples>
|
||||||
|
|
||||||
|
<GameDisplay record={habitualPastVerbGame1} />
|
||||||
|
|
||||||
|
<GameDisplay record={habitualPastVerbGame2} />
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ function ChapterDisplay({ chapter, user, handleClick, expanded }: {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<SmoothCollapse expanded={open}>
|
<SmoothCollapse expanded={open}>
|
||||||
<Game inChapter={false} />
|
{open && <Game inChapter={false} />}
|
||||||
</SmoothCollapse>
|
</SmoothCollapse>
|
||||||
</div>
|
</div>
|
||||||
})}
|
})}
|
||||||
|
|
|
@ -208,7 +208,7 @@ export const transitivePerfectivePastVerbGame2 = makeGameRecord({
|
||||||
});
|
});
|
||||||
export const transitiveImperfectivePastVerbGame1 = makeGameRecord({
|
export const transitiveImperfectivePastVerbGame1 = makeGameRecord({
|
||||||
title: "Write the transitive continuous past verb (one)",
|
title: "Write the transitive continuous past verb (one)",
|
||||||
id: "transitive-imperfective-past-verbs-write",
|
id: "transitive-imperfective-past-verbs-write-1",
|
||||||
link: "/verbs/past-verbs/#past-tense-with-transitive-verbs-",
|
link: "/verbs/past-verbs/#past-tense-with-transitive-verbs-",
|
||||||
level: { level: 1, type :"transitiveImperfectivePast" },
|
level: { level: 1, type :"transitiveImperfectivePast" },
|
||||||
SubCore: VerbGame,
|
SubCore: VerbGame,
|
||||||
|
@ -220,6 +220,34 @@ export const transitiveImperfectivePastVerbGame2 = makeGameRecord({
|
||||||
level: { level: 2, type :"transitiveImperfectivePast" },
|
level: { level: 2, type :"transitiveImperfectivePast" },
|
||||||
SubCore: VerbGame,
|
SubCore: VerbGame,
|
||||||
});
|
});
|
||||||
|
export const habitualPastVerbGame1 = makeGameRecord({
|
||||||
|
title: "Write the habitual past verb (one)",
|
||||||
|
id: "habitual-past-verbs-write-1",
|
||||||
|
link: "/verbs/past-verbs/#habitual-past-tenses",
|
||||||
|
level: { level: 1, type : "habitualPast" },
|
||||||
|
SubCore: VerbGame,
|
||||||
|
});
|
||||||
|
export const habitualPastVerbGame2 = makeGameRecord({
|
||||||
|
title: "Write the habitual past verb (mix)",
|
||||||
|
id: "habitual-past-verbs-write-2",
|
||||||
|
link: "/verbs/past-verbs/#habitual-past-tenses",
|
||||||
|
level: { level: 2, type: "habitualPast" },
|
||||||
|
SubCore: VerbGame,
|
||||||
|
});
|
||||||
|
export const allPastVerbGame1 = makeGameRecord({
|
||||||
|
title: "Write the past verb (one)",
|
||||||
|
id: "all-past-verbs-write-1",
|
||||||
|
link: "/verbs/past-verbs/",
|
||||||
|
level: { level: 1, type : "allPast" },
|
||||||
|
SubCore: VerbGame,
|
||||||
|
});
|
||||||
|
export const allPastVerbGame2 = makeGameRecord({
|
||||||
|
title: "Write past verb (mix)",
|
||||||
|
id: "all-past-verbs-write-2",
|
||||||
|
link: "/verbs/past-verbs/",
|
||||||
|
level: { level: 2, type: "allPast" },
|
||||||
|
SubCore: VerbGame,
|
||||||
|
});
|
||||||
|
|
||||||
const games: { chapter: string, items: GameRecord[] }[] = [
|
const games: { chapter: string, items: GameRecord[] }[] = [
|
||||||
{
|
{
|
||||||
|
@ -265,10 +293,21 @@ const games: { chapter: string, items: GameRecord[] }[] = [
|
||||||
transitiveImperfectivePastVerbGame2,
|
transitiveImperfectivePastVerbGame2,
|
||||||
transitivePerfectivePastVerbGame1,
|
transitivePerfectivePastVerbGame1,
|
||||||
transitivePerfectivePastVerbGame2,
|
transitivePerfectivePastVerbGame2,
|
||||||
|
habitualPastVerbGame1,
|
||||||
|
habitualPastVerbGame2,
|
||||||
|
allPastVerbGame1,
|
||||||
|
allPastVerbGame2,
|
||||||
],
|
],
|
||||||
}
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// check to make sure we have no duplicate game keys
|
||||||
|
games.forEach(({ items }) => {
|
||||||
|
const allAreUnique = (arr: unknown[]) => arr.length === new Set(arr).size;
|
||||||
|
const ids = items.map(x => x.id);
|
||||||
|
if (!allAreUnique(ids)) throw new Error("duplicate game key");
|
||||||
|
})
|
||||||
|
|
||||||
export default games;
|
export default games;
|
||||||
|
|
||||||
function makeGameRecord<T>({ title, id, link, level, SubCore }:{
|
function makeGameRecord<T>({ title, id, link, level, SubCore }:{
|
||||||
|
|
|
@ -6,7 +6,6 @@ import GameCore from "../GameCore";
|
||||||
import {
|
import {
|
||||||
Types as T,
|
Types as T,
|
||||||
defaultTextOptions as opts,
|
defaultTextOptions as opts,
|
||||||
typePredicates as tp,
|
|
||||||
makeNounSelection,
|
makeNounSelection,
|
||||||
randFromArray,
|
randFromArray,
|
||||||
flattenLengths,
|
flattenLengths,
|
||||||
|
@ -35,6 +34,7 @@ import { getVerbFromBlocks } from "@lingdocs/pashto-inflector/dist/lib/phrase-bu
|
||||||
import { baParticle } from "@lingdocs/pashto-inflector/dist/lib/grammar-units";
|
import { baParticle } from "@lingdocs/pashto-inflector/dist/lib/grammar-units";
|
||||||
import { intransitivePastVerbs } from "../../content/verbs/basic-present-verbs";
|
import { intransitivePastVerbs } from "../../content/verbs/basic-present-verbs";
|
||||||
import { makePool } from "../../lib/pool";
|
import { makePool } from "../../lib/pool";
|
||||||
|
import { wordQuery } from "../../words/words";
|
||||||
|
|
||||||
const kidsColor = "#017BFE";
|
const kidsColor = "#017BFE";
|
||||||
|
|
||||||
|
@ -46,35 +46,35 @@ type Question = {
|
||||||
phrase: { ps: T.SingleOrLengthOpts<T.PsString[]>, e?: string[] },
|
phrase: { ps: T.SingleOrLengthOpts<T.PsString[]>, e?: string[] },
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: Make a mechanism where we just create a list of words like "leedul", "wahul" and it searches them out of the pool of words in the grammar
|
const transitivePastVerbs = wordQuery("verbs", [
|
||||||
|
"leedul",
|
||||||
|
"wahul",
|
||||||
|
"khoRul",
|
||||||
|
"shărmawul",
|
||||||
|
"pejzandul",
|
||||||
|
"taRul",
|
||||||
|
]);
|
||||||
|
|
||||||
const transitivePastVerbs: T.VerbEntry[] = [
|
const verbs = wordQuery("verbs", [
|
||||||
{"ts":1527812275,"i":11698,"p":"لیدل","f":"leedul","g":"leedul","e":"to see","c":"v. trans./gramm. trans.","psp":"وین","psf":"ween","tppp":"لید","tppf":"leed","ec":"see,sees,seeing,saw,seen"},
|
"leekul",
|
||||||
{"ts":1527815399,"i":14594,"p":"وهل","f":"wahul","g":"wahul","e":"to hit","c":"v. trans.","tppp":"واهه","tppf":"waahu","ec":"hit,hits,hitting,hit,hit"},
|
"wahul",
|
||||||
{"ts":1527812790,"i":5840,"p":"خوړل","f":"khoRul","g":"khoRul","e":"to eat, to bite","c":"v. trans.","psp":"خور","psf":"khor","tppp":"خوړ","tppf":"khoR","ec":"eat,eats,eating,ate,eaten"},
|
"leedul",
|
||||||
{"ts":1527814596,"i":8398,"p":"شرمول","f":"shărmawul","g":"sharmawul","e":"to shame, to disgrace, to dishonor","c":"v. trans.","ec":"embarrass"},
|
"awredul",
|
||||||
].map(entry => ({ entry })) as T.VerbEntry[]
|
"khoRul",
|
||||||
|
"akhistul",
|
||||||
|
"katul",
|
||||||
|
"lwedul",
|
||||||
|
]);
|
||||||
|
|
||||||
const verbs: T.VerbEntry[] = [
|
const nouns = wordQuery("nouns", [
|
||||||
{"ts":1527812856,"i":11630,"p":"لیکل","f":"leekul","g":"leekul","e":"to write, draw","c":"v. trans./gramm. trans.","ec":"write,writes,writing,wrote,written"},
|
"saRey",
|
||||||
{"ts":1527815399,"i":14480,"p":"وهل","f":"wahul","g":"wahul","e":"to hit","c":"v. trans.","tppp":"واهه","tppf":"waahu","ec":"hit,hits,hitting,hit,hit"},
|
"xudza",
|
||||||
{"ts":1527812275,"i":11608,"p":"لیدل","f":"leedul","g":"leedul","e":"to see","c":"v. trans./gramm. trans.","psp":"وین","psf":"ween","tppp":"لید","tppf":"leed","ec":"see,sees,seeing,saw,seen"},
|
"maashoom",
|
||||||
{"ts":1577049208257,"i":1068,"p":"اورېدل","f":"awredul","g":"awredul","e":"to hear, listen","c":"v. trans./gramm. trans.","psp":"اور","psf":"awr","tppp":"اورېد","tppf":"awred","ec":"hear,hears,hearing,heard"},
|
"puxtoon",
|
||||||
{"ts":1527812790,"i":5813,"p":"خوړل","f":"khoRul","g":"khoRul","e":"to eat, to bite","c":"v. trans.","psp":"خور","psf":"khor","tppp":"خوړ","tppf":"khoR","ec":"eat,eats,eating,ate,eaten"},
|
"Ustaaz",
|
||||||
{"ts":1527812447,"i":292,"p":"اخستل","f":"akhistúl, akhustúl","g":"akhistul,akhustul","e":"to take, buy, purchase, receive; to shave, cut with scissors","c":"v. trans.","psp":"اخل","psf":"akhl","tppp":"اخست","tppf":"akhist","ec":"take,takes,taking,took,taken"},
|
"DaakTar",
|
||||||
{"ts":1527812751,"i":10083,"p":"کتل","f":"katul","g":"katul","e":"to look, see, watch, examine; to meet with","c":"v. trans./gramm. trans.","psp":"ګور","psf":"gor","tppp":"کوت","tppf":"kot","ec":"look"},
|
"halik",
|
||||||
{"ts":1527813994,"i":11654,"p":"لوېدل","f":"lwedul","g":"lwedul","e":"to fall, to tumble, go down, settle","c":"v. intrans.","ec":"fall,falls,falling,fell,fallen"},
|
]);
|
||||||
].map(entry => ({ entry })) as T.VerbEntry[];
|
|
||||||
// @ts-ignore
|
|
||||||
const nouns: T.NounEntry[] = [
|
|
||||||
{"ts":1527815251,"i":7790,"p":"سړی","f":"saRéy","g":"saRey","e":"man","c":"n. m.","ec":"man","ep":"men"},
|
|
||||||
{"ts":1527812797,"i":8605,"p":"ښځه","f":"xúdza","g":"xudza","e":"woman, wife","c":"n. f.","ec":"woman","ep":"women"},
|
|
||||||
{"ts":1527812881,"i":11691,"p":"ماشوم","f":"maashoom","g":"maashoom","e":"child, kid","c":"n. m. anim. unisex","ec":"child","ep":"children"},
|
|
||||||
{"ts":1527815197,"i":2503,"p":"پښتون","f":"puxtoon","g":"puxtoon","e":"Pashtun","c":"n. m. anim. unisex / adj.","infap":"پښتانه","infaf":"puxtaanu","infbp":"پښتن","infbf":"puxtan"},
|
|
||||||
{"ts":1527815737,"i":484,"p":"استاذ","f":"Ustaaz","g":"Ustaaz","e":"teacher, professor, expert, master (in a field)","c":"n. m. anim. unisex anim.","ec":"teacher"},
|
|
||||||
{"ts":1527816747,"i":6418,"p":"ډاکټر","f":"DaakTar","g":"DaakTar","e":"doctor","c":"n. m. anim. unisex"},
|
|
||||||
{"ts":1527812661,"i":13938,"p":"هلک","f":"halík, halúk","g":"halik,haluk","e":"boy, young lad","c":"n. m. anim."},
|
|
||||||
].filter(tp.isNounEntry);
|
|
||||||
|
|
||||||
const persons: T.Person[] = [
|
const persons: T.Person[] = [
|
||||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
|
||||||
|
@ -92,9 +92,10 @@ type VerbGameLevel = {
|
||||||
level: 1 | 2,
|
level: 1 | 2,
|
||||||
type: "presentVerb" | "subjunctiveVerb"
|
type: "presentVerb" | "subjunctiveVerb"
|
||||||
| "futureVerb" | "imperative" | "intransitivePerfectivePast"
|
| "futureVerb" | "imperative" | "intransitivePerfectivePast"
|
||||||
| "intransitiveImperfectivePast" | "transitivePerfectivePast" | "transitiveImperfectivePast";
|
| "intransitiveImperfectivePast" | "transitivePerfectivePast" | "transitiveImperfectivePast"
|
||||||
|
| "allPast" | "habitualPast";
|
||||||
}
|
}
|
||||||
type VerbPoolName = "basic" | "transitivePast" | "intransitivePast";
|
type VerbPoolName = "basic" | "transitivePast" | "intransitivePast" | "mixedPast";
|
||||||
|
|
||||||
function selectVerbPool({ type }: VerbGameLevel): VerbPoolName {
|
function selectVerbPool({ type }: VerbGameLevel): VerbPoolName {
|
||||||
return type === "presentVerb"
|
return type === "presentVerb"
|
||||||
|
@ -111,8 +112,10 @@ function selectVerbPool({ type }: VerbGameLevel): VerbPoolName {
|
||||||
? "intransitivePast"
|
? "intransitivePast"
|
||||||
: type === "transitiveImperfectivePast"
|
: type === "transitiveImperfectivePast"
|
||||||
? "transitivePast"
|
? "transitivePast"
|
||||||
// : type === "transitivePerfectivePast"
|
: type === "transitivePerfectivePast"
|
||||||
: "transitivePast";
|
? "transitivePast"
|
||||||
|
// : type === "habitualPast" || type === "allPast"
|
||||||
|
: "mixedPast";
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Level where you create the formulas (seperate file)
|
// TODO: Level where you create the formulas (seperate file)
|
||||||
|
@ -132,6 +135,7 @@ const VerbGame: GameSubCore<VerbGameLevel> = ({ id, link, level, inChapter }: {
|
||||||
basic: makePool(verbs, 15),
|
basic: makePool(verbs, 15),
|
||||||
transitivePast: makePool(transitivePastVerbs, 15),
|
transitivePast: makePool(transitivePastVerbs, 15),
|
||||||
intransitivePast: makePool(intransitivePastVerbs, 15),
|
intransitivePast: makePool(intransitivePastVerbs, 15),
|
||||||
|
mixedPast: makePool([...transitivePastVerbs, ...intransitivePastVerbs], 15),
|
||||||
};
|
};
|
||||||
const oneVerb: T.VerbEntry = verbPools[selectVerbPool(level)]();
|
const oneVerb: T.VerbEntry = verbPools[selectVerbPool(level)]();
|
||||||
const getVerb = level.level === 1
|
const getVerb = level.level === 1
|
||||||
|
@ -145,7 +149,7 @@ const VerbGame: GameSubCore<VerbGameLevel> = ({ id, link, level, inChapter }: {
|
||||||
number: n.numberCanChange ? randFromArray(["singular", "plural"]) : n.number,
|
number: n.numberCanChange ? randFromArray(["singular", "plural"]) : n.number,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
function makeRandomVPS(l: T.VerbTense | T.ImperativeTense): T.VPSelectionComplete {
|
function makeRandomVPS(tense: T.VerbTense | T.ImperativeTense): T.VPSelectionComplete {
|
||||||
function personToNPSelection(p: T.Person): T.NPSelection {
|
function personToNPSelection(p: T.Person): T.NPSelection {
|
||||||
if (isThirdPerson(p)) {
|
if (isThirdPerson(p)) {
|
||||||
return {
|
return {
|
||||||
|
@ -175,10 +179,6 @@ const VerbGame: GameSubCore<VerbGameLevel> = ({ id, link, level, inChapter }: {
|
||||||
do {
|
do {
|
||||||
servant = randomPerson();
|
servant = randomPerson();
|
||||||
} while (isInvalidSubjObjCombo(king, servant));
|
} while (isInvalidSubjObjCombo(king, servant));
|
||||||
// const tense = (l === "allIdentify" || l === "allProduce")
|
|
||||||
// ? randFromArray(tenses)
|
|
||||||
// : l;
|
|
||||||
const tense = l;
|
|
||||||
return makeVPS({
|
return makeVPS({
|
||||||
verb,
|
verb,
|
||||||
king: personToNPSelection(king),
|
king: personToNPSelection(king),
|
||||||
|
@ -212,6 +212,11 @@ const VerbGame: GameSubCore<VerbGameLevel> = ({ id, link, level, inChapter }: {
|
||||||
const [answer, setAnswer] = useState<string>("");
|
const [answer, setAnswer] = useState<string>("");
|
||||||
const [withBa, setWithBa] = useState<boolean>(false);
|
const [withBa, setWithBa] = useState<boolean>(false);
|
||||||
const handleInput = ({ target: { value }}: React.ChangeEvent<HTMLInputElement>) => {
|
const handleInput = ({ target: { value }}: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
if (value === "به " || value === "به ") {
|
||||||
|
setWithBa(true);
|
||||||
|
setAnswer("");
|
||||||
|
return;
|
||||||
|
}
|
||||||
setAnswer(value);
|
setAnswer(value);
|
||||||
}
|
}
|
||||||
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
|
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
|
||||||
|
@ -388,7 +393,12 @@ function levelToDescription({ type }: VerbGameLevel): string {
|
||||||
? "continuous past transitive"
|
? "continuous past transitive"
|
||||||
: type === "transitivePerfectivePast"
|
: type === "transitivePerfectivePast"
|
||||||
? "simple past transitive"
|
? "simple past transitive"
|
||||||
: "imperfective imperative or perfective imperative";
|
: type === "imperative"
|
||||||
|
? "imperfective imperative or perfective imperative"
|
||||||
|
: type === "allPast"
|
||||||
|
? "past tense"
|
||||||
|
// : type === "habitualPast"
|
||||||
|
: "habitual past";
|
||||||
}
|
}
|
||||||
|
|
||||||
function levelToTense({ type }: VerbGameLevel): T.VerbTense | T.ImperativeTense {
|
function levelToTense({ type }: VerbGameLevel): T.VerbTense | T.ImperativeTense {
|
||||||
|
@ -400,10 +410,19 @@ function levelToTense({ type }: VerbGameLevel): T.VerbTense | T.ImperativeTense
|
||||||
? randFromArray(["perfectiveFuture", "imperfectiveFuture"])
|
? randFromArray(["perfectiveFuture", "imperfectiveFuture"])
|
||||||
: type === "imperative"
|
: type === "imperative"
|
||||||
? randFromArray(["perfectiveImperative", "imperfectiveImperative"])
|
? randFromArray(["perfectiveImperative", "imperfectiveImperative"])
|
||||||
: type.includes("ImperfectivePast")
|
: (type === "intransitiveImperfectivePast" || type === "transitiveImperfectivePast")
|
||||||
? "imperfectivePast"
|
? "imperfectivePast"
|
||||||
// : level.includes("perfectivePast")
|
: (type === "intransitivePerfectivePast" || type === "transitivePerfectivePast")
|
||||||
: "perfectivePast";
|
? "perfectivePast"
|
||||||
|
: type === "habitualPast"
|
||||||
|
? randFromArray(["habitualPerfectivePast", "habitualImperfectivePast"])
|
||||||
|
// : type === "allPast"
|
||||||
|
: randFromArray([
|
||||||
|
"perfectivePast",
|
||||||
|
"imperfectivePast",
|
||||||
|
"habitualPerfectivePast",
|
||||||
|
"habitualImperfectivePast",
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function makeVPS({ verb, king, servant, tense, defaultTransitivity }: {
|
function makeVPS({ verb, king, servant, tense, defaultTransitivity }: {
|
||||||
|
|
|
@ -17,6 +17,7 @@ module.exports = [
|
||||||
1527817664, // تود
|
1527817664, // تود
|
||||||
1577408901204, // ځنګون
|
1577408901204, // ځنګون
|
||||||
1527819238, // ورون
|
1527819238, // ورون
|
||||||
|
1527815162, // پتنوس
|
||||||
1527816071, // خپور
|
1527816071, // خپور
|
||||||
1574865652928, // خوږ
|
1574865652928, // خوږ
|
||||||
1527813499, // دروند
|
1527813499, // دروند
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
module.exports = [
|
module.exports = [
|
||||||
|
1527817036, // astáazey
|
||||||
1582853867682, // اوسېدونکی
|
1582853867682, // اوسېدونکی
|
||||||
1527813469, // بخښونکی
|
1527813469, // بخښونکی
|
||||||
1527817829, // پوروړی
|
1527817829, // پوروړی
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -7,6 +7,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
module.exports = [
|
module.exports = [
|
||||||
|
1527813710, // zeGedul
|
||||||
1527813473,// الوتل - to fly
|
1527813473,// الوتل - to fly
|
||||||
1527814012,// اوښتل - to pass over, overturn, be flipped over, spill over, shift, change, diverge, pass, cross, abandon
|
1527814012,// اوښتل - to pass over, overturn, be flipped over, spill over, shift, change, diverge, pass, cross, abandon
|
||||||
1527822843,// برېښېدل - to appear, seem; to shine, sparkle; to smart, have a pricking pain
|
1527822843,// برېښېدل - to appear, seem; to shine, sparkle; to smart, have a pricking pain
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
module.exports = [
|
module.exports = [
|
||||||
1527814617, // نیول - to take
|
1527814617, // نیول - to take
|
||||||
|
1527812447, // akhistul
|
||||||
1527811872, // اچول - to put, pour, drop, throw, put on
|
1527811872, // اچول - to put, pour, drop, throw, put on
|
||||||
1527817298, // اخیستل - to take, buy, purchase, receive; to shave, cut with scissors
|
1527817298, // اخیستل - to take, buy, purchase, receive; to shave, cut with scissors
|
||||||
1527816127, // اړول - to turn over, flip over; convert, change; to move over to, establish oneself in a new spot; divert, turn away, hijack
|
1527816127, // اړول - to turn over, flip over; convert, change; to move over to, establish oneself in a new spot; divert, turn away, hijack
|
||||||
|
|
|
@ -31,7 +31,23 @@ export function wordQuery(category: "nouns", w: string[]): T.NounEntry[];
|
||||||
export function wordQuery(category: "adjectives", w: string[]): T.AdjectiveEntry[];
|
export function wordQuery(category: "adjectives", w: string[]): T.AdjectiveEntry[];
|
||||||
export function wordQuery(category: "adverbs", w: string[]): T.AdverbEntry[];
|
export function wordQuery(category: "adverbs", w: string[]): T.AdverbEntry[];
|
||||||
export function wordQuery(category: "locativeAdverbs", w: string[]): T.LocativeAdverbEntry[];
|
export function wordQuery(category: "locativeAdverbs", w: string[]): T.LocativeAdverbEntry[];
|
||||||
export function wordQuery(category: "nouns" | "adjectives" | "adverbs" | "locativeAdverbs", w: string[]): T.NounEntry[] | T.AdjectiveEntry[] | T.AdverbEntry[] | T.LocativeAdverbEntry[] {
|
export function wordQuery(category: "verbs", w: string[]): T.VerbEntry[];
|
||||||
|
export function wordQuery(
|
||||||
|
category: "nouns" | "adjectives" | "adverbs" | "locativeAdverbs" | "verbs",
|
||||||
|
w: string[],
|
||||||
|
): T.NounEntry[] | T.AdjectiveEntry[] | T.AdverbEntry[] | T.LocativeAdverbEntry[] | T.VerbEntry[] {
|
||||||
|
if (category === "verbs") {
|
||||||
|
return w.map(word => {
|
||||||
|
const l = words[category];
|
||||||
|
const found = l.find(x => vMatches(x, word));
|
||||||
|
if (!found) throw new Error(`${word} not found by wordQuery`);
|
||||||
|
return found;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function vMatches(x: T.VerbEntry, y: string) {
|
||||||
|
return (y === x.entry.p)
|
||||||
|
|| (removeAccents(y) === removeAccents(removeFVarients(x.entry.f)));
|
||||||
|
}
|
||||||
function wMatches(x: T.DictionaryEntry, y: string) {
|
function wMatches(x: T.DictionaryEntry, y: string) {
|
||||||
return (y === x.p)
|
return (y === x.p)
|
||||||
|| (removeAccents(y) === removeAccents(removeFVarients(x.f)));
|
|| (removeAccents(y) === removeAccents(removeFVarients(x.f)));
|
||||||
|
|
|
@ -1804,10 +1804,10 @@
|
||||||
rambda "^6.7.0"
|
rambda "^6.7.0"
|
||||||
react-select "^5.2.2"
|
react-select "^5.2.2"
|
||||||
|
|
||||||
"@lingdocs/pashto-inflector@^3.8.8":
|
"@lingdocs/pashto-inflector@^3.8.9":
|
||||||
version "3.8.8"
|
version "3.8.9"
|
||||||
resolved "https://npm.lingdocs.com/@lingdocs%2fpashto-inflector/-/pashto-inflector-3.8.8.tgz#fd9f2344b8ea6c6a541a24c565b5b0a771e53915"
|
resolved "https://npm.lingdocs.com/@lingdocs%2fpashto-inflector/-/pashto-inflector-3.8.9.tgz#c023449dc13dbc32ef95cef172a68b5b0b4659bf"
|
||||||
integrity sha512-GUr3MwM6m0+IqFQopkn1+/s2rEF8u626ZpvullGVejB+Z5PEcIV5WzulM6aDAqgsMCPAy7qulJIxjQ9anGSvcw==
|
integrity sha512-60hAao+ADerI5hOMeJzYmrSCliwTqCndbUlx1Ke58s2FikxDqUb9/wb700JVbhsVLyRdr6tGg+YslDf4irr5tA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@formkit/auto-animate" "^1.0.0-beta.1"
|
"@formkit/auto-animate" "^1.0.0-beta.1"
|
||||||
classnames "^2.2.6"
|
classnames "^2.2.6"
|
||||||
|
|
Loading…
Reference in New Issue