only get a point in practice when the answer is not showing
This commit is contained in:
parent
041be33c75
commit
6b0a074521
|
@ -131,7 +131,7 @@ function GameCore<Question>({ inChapter, getQuestion, amount, Display, DisplayCo
|
||||||
}
|
}
|
||||||
else /* (gs.mode === "practice") */ {
|
else /* (gs.mode === "practice") */ {
|
||||||
if (action.payload.correct) {
|
if (action.payload.correct) {
|
||||||
const numberComplete = gs.numberComplete + 1;
|
const numberComplete = gs.numberComplete + (!gs.showAnswer ? 1 : 0);
|
||||||
return {
|
return {
|
||||||
...gs,
|
...gs,
|
||||||
numberComplete,
|
numberComplete,
|
||||||
|
|
|
@ -5,6 +5,7 @@ import {
|
||||||
randFromArray,
|
randFromArray,
|
||||||
} from "@lingdocs/pashto-inflector";
|
} from "@lingdocs/pashto-inflector";
|
||||||
import { makePool } from "../../lib/pool";
|
import { makePool } from "../../lib/pool";
|
||||||
|
import { wordQuery } from "../../words/words";
|
||||||
|
|
||||||
const pronouns: T.Person[] = [
|
const pronouns: T.Person[] = [
|
||||||
0, 1, 2, 3, 4, 4, 5, 5, 6, 7, 8, 9, 10, 11,
|
0, 1, 2, 3, 4, 4, 5, 5, 6, 7, 8, 9, 10, 11,
|
||||||
|
@ -14,16 +15,15 @@ const tenses: T.EquativeTense[] = [
|
||||||
"present", "habitual", "subjunctive", "future", "past", "wouldBe", "pastSubjunctive", "wouldHaveBeen"
|
"present", "habitual", "subjunctive", "future", "past", "wouldBe", "pastSubjunctive", "wouldHaveBeen"
|
||||||
];
|
];
|
||||||
|
|
||||||
// @ts-ignore
|
const nouns = wordQuery("nouns", [
|
||||||
const nouns: T.NounEntry[] = [
|
"saRey",
|
||||||
{"ts":1527815251,"i":7790,"p":"سړی","f":"saRéy","g":"saRey","e":"man","c":"n. m.","ec":"man","ep":"men"},
|
"xudza",
|
||||||
{"ts":1527812797,"i":8605,"p":"ښځه","f":"xúdza","g":"xudza","e":"woman, wife","c":"n. f.","ec":"woman","ep":"women"},
|
"maashoom",
|
||||||
{"ts":1527812881,"i":11691,"p":"ماشوم","f":"maashoom","g":"maashoom","e":"child, kid","c":"n. m. anim. unisex","ec":"child","ep":"children"},
|
"Ustaaz",
|
||||||
{"ts":1527815197,"i":2503,"p":"پښتون","f":"puxtoon","g":"puxtoon","e":"Pashtun","c":"n. m. anim. unisex / adj.","infap":"پښتانه","infaf":"puxtaanu","infbp":"پښتن","infbf":"puxtan"},
|
"puxtoon",
|
||||||
{"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"},
|
"DaakTar",
|
||||||
{"ts":1527816747,"i":6418,"p":"ډاکټر","f":"DaakTar","g":"DaakTar","e":"doctor","c":"n. m. anim. unisex"},
|
"halik",
|
||||||
{"ts":1527812661,"i":13938,"p":"هلک","f":"halík, halúk","g":"halik,haluk","e":"boy, young lad","c":"n. m. anim."},
|
]);
|
||||||
].filter(tp.isNounEntry);
|
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const adjectives: T.AdjectiveEntry[] = [
|
const adjectives: T.AdjectiveEntry[] = [
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
module.exports = [
|
module.exports = [
|
||||||
|
{ ts: 1527815737, e: "teacher", }, // استاذ
|
||||||
|
{ ts: 1527816747, e: "Doctor" },
|
||||||
{ ts: 1527821744, e: `cook, chef` }, // آشپز - aashpáz
|
{ ts: 1527821744, e: `cook, chef` }, // آشپز - aashpáz
|
||||||
{ ts: 1527812156, e: `officer` }, // افسر - afsar
|
{ ts: 1527812156, e: `officer` }, // افسر - afsar
|
||||||
{ ts: 1591872915426, e: `Afghan (person)` }, // افغانی - afghaanéy
|
{ ts: 1591872915426, e: `Afghan (person)` }, // افغانی - afghaanéy
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,5 +1,7 @@
|
||||||
import rawWords from "./raw-words";
|
import rawWords from "./raw-words";
|
||||||
import {
|
import {
|
||||||
|
removeAccents,
|
||||||
|
removeFVarients,
|
||||||
typePredicates as tp,
|
typePredicates as tp,
|
||||||
Types as T,
|
Types as T,
|
||||||
} from "@lingdocs/pashto-inflector";
|
} from "@lingdocs/pashto-inflector";
|
||||||
|
@ -23,6 +25,24 @@ export default words;
|
||||||
|
|
||||||
export const { nouns, adjectives, verbs, adverbs, locativeAdverbs } = words;
|
export const { nouns, adjectives, verbs, adverbs, locativeAdverbs } = words;
|
||||||
|
|
||||||
|
export function wordQuery(category: "nouns", w: string[]): T.NounEntry[];
|
||||||
|
export function wordQuery(category: "adjectives", w: string[]): T.AdjectiveEntry[];
|
||||||
|
export function wordQuery(category: "adverbs", w: string[]): T.AdverbEntry[];
|
||||||
|
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[] {
|
||||||
|
function wMatches(x: T.DictionaryEntry, y: string) {
|
||||||
|
return (y === x.p)
|
||||||
|
|| (removeAccents(y) === removeAccents(removeFVarients(x.f)));
|
||||||
|
}
|
||||||
|
return w.map(word => {
|
||||||
|
const l = words[category];
|
||||||
|
// @ts-ignore
|
||||||
|
const found = l.find(x => wMatches(x, word));
|
||||||
|
if (!found) throw new Error(`${word} not found by wordQuery`);
|
||||||
|
return found;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// console.log(
|
// console.log(
|
||||||
// Object.entries(
|
// Object.entries(
|
||||||
// intoPatterns([
|
// intoPatterns([
|
||||||
|
|
Loading…
Reference in New Issue