only get a point in practice when the answer is not showing

This commit is contained in:
lingdocs 2022-09-05 21:45:02 +04:00
parent 041be33c75
commit 6b0a074521
5 changed files with 34 additions and 12 deletions

View File

@ -131,7 +131,7 @@ function GameCore<Question>({ inChapter, getQuestion, amount, Display, DisplayCo
}
else /* (gs.mode === "practice") */ {
if (action.payload.correct) {
const numberComplete = gs.numberComplete + 1;
const numberComplete = gs.numberComplete + (!gs.showAnswer ? 1 : 0);
return {
...gs,
numberComplete,

View File

@ -5,6 +5,7 @@ import {
randFromArray,
} from "@lingdocs/pashto-inflector";
import { makePool } from "../../lib/pool";
import { wordQuery } from "../../words/words";
const pronouns: T.Person[] = [
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"
];
// @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 nouns = wordQuery("nouns", [
"saRey",
"xudza",
"maashoom",
"Ustaaz",
"puxtoon",
"DaakTar",
"halik",
]);
// @ts-ignore
const adjectives: T.AdjectiveEntry[] = [

View File

@ -1,4 +1,6 @@
module.exports = [
{ ts: 1527815737, e: "teacher", }, // استاذ
{ ts: 1527816747, e: "Doctor" },
{ ts: 1527821744, e: `cook, chef` }, // آشپز - aashpáz
{ ts: 1527812156, e: `officer` }, // افسر - afsar
{ ts: 1591872915426, e: `Afghan (person)` }, // افغانی - afghaanéy

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,7 @@
import rawWords from "./raw-words";
import {
removeAccents,
removeFVarients,
typePredicates as tp,
Types as T,
} from "@lingdocs/pashto-inflector";
@ -23,6 +25,24 @@ export default 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(
// Object.entries(
// intoPatterns([