) => {
+ e.preventDefault();
+ const a = answer.replace(" ګ", "ګ").replace(" گ", "گ");
+ const correct = comparePs(a, question.plural);
+ if (correct) {
+ setAnswer("");
+ }
+ callback(correct);
+ };
+ function makePartOfSpeechInfo(q: Question) {
+ return `(n. ${q.gender === "masc" ? "m" : "f"}. ${
+ q.entry.c?.includes("anim.") ? "anim." : ""
+ })`;
+ }
+
+ return (
+
+
+
+ {[
+ {
+ ...question.singular,
+ e: `${firstVariation(question.entry.e)} ${makePartOfSpeechInfo(
+ question
+ )}`,
+ },
+ ]}
+
+
+
is a singular noun. Make it plural.
+
+
+ );
+ }
+
+ function Instructions() {
+ return (
+
+
Make the given noun plural
+
+ );
+ }
+
+ function DisplayCorrectAnswer({ question }: { question: Question }) {
+ return (
+
+ {question.plural.length > 1 && (
+
One of the following:
+ )}
+ {question.plural.map((ps: any) => (
+
{ps}
+ ))}
+
+ );
+ }
+
+ return (
+
+ );
+}
diff --git a/src/lib/pool.tsx b/src/lib/pool.tsx
index 4bc9936..e12bd52 100644
--- a/src/lib/pool.tsx
+++ b/src/lib/pool.tsx
@@ -2,36 +2,35 @@ import { randFromArray } from "@lingdocs/ps-react";
import equal from "fast-deep-equal";
/**
- *
+ *
* @param poolBase an array of things you want to use as the pool to pick from
- * @param removalLaxity If set, thery will be a n% chance that the pick will NOT
+ * @param removalLaxity If set, thery will be a n% chance that the pick will NOT
* be removed after use. Defaults to 0, meaning that every time an item is picked
* it is removed from the. 100 means that items will never be removed from the pool.
- * @returns
+ * @returns
*/
export function makePool(poolBase: P[], removalLaxity = 0): () => P {
- let pool = [...poolBase];
- function shouldStillKeepIt() {
- if (!removalLaxity) return false;
- return Math.random() < (removalLaxity / 100);
+ let pool = [...poolBase];
+ function shouldStillKeepIt() {
+ if (!removalLaxity) return false;
+ return Math.random() < removalLaxity / 100;
+ }
+ function pickRandomFromPool(): P {
+ // Pick an item from the pool;
+ const pick = randFromArray(pool);
+ // Remove the (first occurance of) the item from the pool
+ // This step might be skipped if the removal laxity is set
+ if (shouldStillKeepIt()) {
+ return pick;
}
- function pickRandomFromPool(): P {
- // Pick an item from the pool;
- const pick = randFromArray(pool);
- // Remove the (first occurance of) the item from the pool
- // This step might be skipped if the removal laxity is set
- if (shouldStillKeepIt()) {
- return pick;
- }
- const index = pool.findIndex(v => equal(v, pick))
- if (index === -1) throw new Error("could not find pick from pool");
- pool.splice(index, 1);
- // If the pool is empty, reset it
- if (pool.length === 0) {
- pool = [...poolBase];
- }
- return pick;
+ const index = pool.findIndex((v) => equal(v, pick));
+ if (index === -1) throw new Error("could not find pick from pool");
+ pool.splice(index, 1);
+ // If the pool is empty, reset it
+ if (pool.length === 0) {
+ pool = [...poolBase];
}
- return pickRandomFromPool;
+ return pick;
+ }
+ return pickRandomFromPool;
}
-
diff --git a/src/main.tsx b/src/main.tsx
index 1b03f79..75c7df9 100644
--- a/src/main.tsx
+++ b/src/main.tsx
@@ -1,13 +1,11 @@
-import React from 'react'
-import ReactDOM from 'react-dom/client'
-import App from './App'
+import React from "react";
+import ReactDOM from "react-dom/client";
+import App from "./App";
import "bootstrap/dist/css/bootstrap.min.css";
import "@fortawesome/fontawesome-free/css/all.css";
import { registerSW } from "virtual:pwa-register";
-import {
- BrowserRouter,
-} from "react-router-dom";
-import { UserProvider} from "./user-context";
+import { BrowserRouter } from "react-router-dom";
+import { UserProvider } from "./user-context";
const updateSW = registerSW({
onNeedRefresh() {
@@ -20,12 +18,12 @@ const updateSW = registerSW({
},
});
-ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
+ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
- ,
+
);
diff --git a/src/words/adverbs.js b/src/words/adverbs.js
index 9fcd173..d36e12a 100644
--- a/src/words/adverbs.js
+++ b/src/words/adverbs.js
@@ -1,8 +1,6 @@
export default [
1527812449, // هلته - hálta, álta
- 1527813043, // بې له ټاله - be la Taala
1527823145, // بېرون - beróon
- 1527811735, // هنرمندانه - hUnarmandaana
1527813516, // څنګه - tsanga, tsunga
1578014249199, // پکښې - pukxe
1527821618, // احمقانه - ahmaqaana
@@ -18,10 +16,7 @@ export default [
1527811221, // پورته - porta
1611401028364, // جسماً - jismán
1527815099, // نا وخته - naa wakhta
- 1527823029, // برالا - baraalaa
1527817154, // پسې - pase
- 1527818325, // اېله - elá
- 1610796256372, // مخ په وړاندې - mukh pu wRaande
1527819870, // په ناحقه - pu naahaqa
1527815228, // رو - roo
1575236274891, // دوري - dóoree
@@ -54,7 +49,6 @@ export default [
1527823231, // په جڼه جڼه - pu jaNa jaNa
1527812890, // معمولاً - mamoolan
1586363985796, // روزانه - rozaaná
- 1527819008, // مطلق العنان - mUtlaq-Ul-'ináan
1527822660, // خود به خود - khoodbakhood
1527823364, // باوجود - baawujood
1527820143, // پسته - pasta
@@ -71,7 +65,6 @@ export default [
1527821224, // فقط - faqát
1527817302, // یوځای - yodzaay
1527820499, // عاریتاً - aariyatan
- 1527815959, // دم درحال - dam dărhaal
1527821253, // نزدې - nizde, nazde
1527815997, // بدبختانه - badbakhtaana
1584688791272, // په لوی لاس - pu looy laas
@@ -147,10 +140,8 @@ export default [
1527814710, // نژدې پر نژدې - najzde par najzde
1527821743, // ابتداً - ibtidán
1527817155, // پرله پسې - parlapase
- 1527818323, // ایله - eelá
1527822464, // تقلیداً - taqleedan
1527813650, // لکه - lăka
- 1527811618, // منحیث - minheys
1527822465, // تقلیفاً - taqleefan
1527817294, // پاس - paas
1527819016, // مستقیماً - mUstaqeeman
@@ -197,7 +188,6 @@ export default [
1527820087, // وخت ناوخت - wakhtnaawakht
1527814163, // اخوا - akhwaa
1527822165, // سیده - seeda
- 1527814912, // رانږدې - raanaGde
1593176318060, // ډانګ پېیلی - Daang pe`yúley
1527819455, // د دې له کبله - du de la kabala
1578330078760, // بدبد - badbad, budbud
@@ -222,7 +212,6 @@ export default [
1527811327, // صمیمانه - sameemaana
1577390207734, // پرې - pre
1527818716, // تدریجاً - tadreejan
- 1527822285, // کل - kUl
1527822183, // شرعاً - sharan
1527818276, // پرمهال - purmahaal
1527814270, // له بده مرغه - la buda margha, la buda murgha
@@ -248,10 +237,8 @@ export default [
1527813595, // چندان - chandaan
1527811222, // په څېر - pu tser
1527813692, // په خاطر - pu khaatir
- 1623688507454, // ګنګوړ - gangóR, gangwÚR
1527820344, // په داوطلب ډول - pu daawtaláb Dawul
1527811360, // هم مهاله - hammahaala
- 1527812498, // بلې - băle
1586262008294, // پېټ - peT
1527818646, // یو په دوه - yawpudwá
1527812762, // خالي - khaalee
@@ -305,7 +292,6 @@ export default [
1578080952673, // دباندې - dubaande
1527813323, // خوشبختانه - khoshbakhtaana
1527819156, // ظالمانه - zaalimaana
- 1527818313, // پنځلس ورځنی - pindzúlaswradzanéy
1527812670, // هسې - hase
1527818324, // په مټې - pumúTe
1527820205, // کله ناکله - kalanaakala
@@ -313,7 +299,6 @@ export default [
1527813688, // کوز - kooz
1527821666, // آمرانه - aamuraana
1527817845, // کټ مټ - kaTmaT, kuTmuT
- 1527822351, // تېر و بېر - ter-U-ber
1527813618, // طبعاً - taban
1527821531, // تل - tul
1527817255, // لیرې - leere
@@ -373,8 +358,6 @@ export default [
1527820289, // واقعاً - waaqi'an, waaqiyan
1588786919406, // زر تر زره - zur tur zura
1575642923868, // حتیٰ - hattaa
- 1527813261, // هله - hala
- 1593173287113, // مجمل - mUjmál
1527815224, // رښتیا - rixtiyaa
1594909066356, // خوا و شا - khwaa-U-shaa
1527819344, // پسه - pása
@@ -387,9 +370,7 @@ export default [
1527821125, // په منطقي ډول - pu mantiqee Dawul
1527812137, // تل تر تله - tulturtula
1527812375, // واپس - waapus
- 1527821736, // په موقت ډول - pu mUwaqqat Dawul
1527816129, // خواره واره - khwaarawaara
- 1527812572, // د ... په شان - du … pu shaan
1527811423, // لاندې - laande
1527820416, // حاکمانه - haakimaana
1527812866, // لږترلږه - luG tur luGa
@@ -407,7 +388,6 @@ export default [
1527813061, // بې درنګه - bediranga
1527818056, // فی الحال - filháal
1527818654, // عین - ayn
- 1527818669, // ماشومانه - maashoomaana
1527822765, // له واره - la waara
1527814913, // ورنږدې - warnaGde
1527816312, // تخمیناً - takhmeenan
@@ -419,8 +399,6 @@ export default [
1527811244, // آن - aan
1527816949, // هومره - hoomra
1527821995, // اخر - akhúr, akhír
- 1527817078, // خود - khood, khwud
- 1527823176, // آخود - aakhwad
1586626956539, // درست - drust, drast
1527818644, // برحال - barháal
1527815340, // تکرار - tăkraar
@@ -442,21 +420,14 @@ export default [
1527820921, // علیحده - aleyhida, alaeyda
1527817376, // درڅخه - dărtsukha
1527822852, // دېخوا هاخوا - dekhwaa haakhwaa
- 1527820103, // یوموټ - yawmóoT
1527820737, // هغسې - haghase
1527823338, // هاغومره - haaghoomra
1527814318, // مخکښې - mukhkxe
- 1584689070748, // نامستقیم - naamUstaqeem
- 1527821752, // ماسوا - maasiwáa
1591382269266, // قابو - qaaboo
1527818586, // بلا استثنیٰ - bilaaistisnaa
1527820750, // چوټ انداز - choT andaaz, chooT andaaz ??
1527812504, // بېرته - berta
- 1571526377164, // کډن - kaDún
1527819764, // ماهانه - maahaaná
- 1527822366, // حق ناحق - haqnaaháq
- 1527819438, // لېرې - lere
- 1527819392, // برسېره - barséra
1527822184, // اخلاقاً - akhlaaqan
1527813260, // تماماً - tamaaman
1588758935200, // وراخوا - wăraakhwaa
@@ -489,7 +460,6 @@ export default [
1527812415, // سم دلاسه - samdulaasa
1527823339, // هغومره - haghoomra
1527821616, // مظلومانه - mazloomaana
- 1584691547040, // مودبانه - mUaddabaana
1527812324, // هاسې په هاسې - haase pu haase
1527815420, // وروسته - wroosta
1527818595, // قدرتاً - qUdratan
diff --git a/src/words/nouns-adjs.js b/src/words/nouns-adjs.js
index ebc6e27..5b7d221 100644
--- a/src/words/nouns-adjs.js
+++ b/src/words/nouns-adjs.js
@@ -9,9 +9,8 @@ export default [
1527817146, // استوګن - astogan
1527813713, // امیدوار - Umeedwaar
1527819451, // انګرېز - angréz
- 1527820346, // انلاین - anlaayn
1527813667, // اهم - aham
- 1598724912198, // اوچ - ooch
+ 1527815130, // اوچ - wuch
1586452587974, // اوزګار - oozgáar
1527816489, // ایماندار - eemaandaar
1527820433, // باتور - baatóor
@@ -23,14 +22,12 @@ export default [
1527812515, // بل - bul
1527815725, // بلد - balad
1577301753727, // بند - band
- 1527812490, // بې کار - be kaar
1527812031, // بېل - bel
1527815144, // پاک - paak
1527815201, // پټ - puT
1527815179, // پلن - plun
1527819059, // پنډ - punD
1611767359178, // ترسناک - tarsnáak
- 1527813270, // تروش - troosh
1527813817, // تنګ - tang
1527816354, // تیار - tayaar
1527817056, // تېز - tez
@@ -38,7 +35,6 @@ export default [
1527819864, // ټیټ - TeeT
1527811894, // ټینګ - Teeng
1527812943, // ثابت - saabit
- 1527813085, // ثقیل - saqeel
1527820479, // جاهل - jaahíl
1588160800930, // جراح - jarráah
1527812707, // جګ - jig, jug
@@ -215,7 +211,6 @@ export default [
1527813115, // ادعا - idaa
1527818119, // امسا - amsaa
- 1527815043, // جزا - jazaa
1527819022, // څا - tsaa
1527814225, // خطا - khataa
1610797589510, // خلا - khaláa
@@ -240,6 +235,16 @@ export default [
1610443988250, // وېشلتیا - weshiltyaa, weshiltiyaa
1527816806, // وینا - waynaa
+ 1527815163, // پیشو - peesho
+ 1527822272, // باڼو - baaNoo
+ 1527823587, // بازو - baazoo
+ 1527813463, // چاقو - chaaqóo
+ 1527821599, // پارو - paaróo
+ 1596290955751, // تالو - taalóo
+
+ 1674934574643, // ویډیو - weeDiyo
+ 1566468038374, // بیزو - beezo
+
1527815197, // پښتون
1527813148, // پروت
1574867531681, // پوخ
@@ -278,6 +283,7 @@ export default [
1576113803291, // ووړ
1527819244, // کوربه
1527812908, // مېلمه
+ 1527813270, // تروش - troosh
1527814150, // لار - laar
1527815417, // ورځ - wradz
@@ -400,6 +406,12 @@ export default [
1527822208, // وطواط - watwáat
1527819571, // وهم - wáhum, wahm
1527816332, // ویاړ - wyaaR
+ 1527816747, // ډاکټر - DaakTár
+ 1527812849, // لاس - laas
+ 1527814158, // دوست - dost
+ 1527815711, // مار - maar
+ 1527820043, // چرګ - charg
+ 1527815127, // نرس - nurs
1568926976497, // اکسرې - iksre
1602179757779, // الف بې - alif be
@@ -446,6 +458,7 @@ export default [
1527813462, // کیلي - keelee
1527814492, // ګاوداري - gaawdaaree
1610013679820, // ورورولي - wrorwalée
+ 1527816247, // سختي - sakhtee
1527821971, // بن - bun
1527816397, // ترور - tror
@@ -492,6 +505,7 @@ export default [
1579041957559, // ندا - nadáa
1527816253, // نواسه - nawaasa
1527819971, // والي - waalée
+ 1527812456, // اړتیا - aRtyaa
1573659054031, // ارتوالی - artwaaley, aratwaaley
1527811890, // ازغی - azghey
@@ -629,7 +643,6 @@ export default [
1527820130, // پلوی - palawéy
1582390092514, // پورتنی - portinéy
1610617741649, // ځنډنی - dzanDanéy, dzanDunéy
- 1610793723568, // چېلی - cheléy
1527819362, // خوسی - khooséy
1590052667427, // درستی - drustéy, drastéy
1527822854, // ړومبی - Roombéy
@@ -654,6 +667,7 @@ export default [
1527821373, // هوسی - hoséy
1527813636, // وروستی - wroostéy
1527815430, // یوازنی - yawaazunéy
+ 1714029848228, // ایرانی - eeraanáy
1527817036, // astáazey
1582853867682, // اوسېدونکی
@@ -815,7 +829,6 @@ export default [
1527818255, // لېوه - lewú
1527821522, // مریه - mrayú
1527812911, // مېړه - meRu
- 1527811626, // نکېده - nukedu
1527816410, // نیکه - neekú
1527822420, // واګه - waagu
1527816357, // وراره - wraaru
@@ -823,6 +836,7 @@ export default [
1527814789, // وېښته - wextu
1527815394, // واده - waadú
+ 1527823526, // قاضۍ - qaazúy
1527818017, // اټۍ - aTuy
1527812694, // انجنۍ - injUnuy
1527815140, // اونۍ - onuy, ownuy, owunuy
@@ -852,7 +866,6 @@ export default [
1527812594, // ځای - dzaay
1527812525, // چای - chaay
1527812783, // خدای - khUdaay
- 1527819514, // دای - daay
1610797797756, // سای - saay
1527822345, // سرای - saráay
1586598425514, // بوی - booy
diff --git a/yarn.lock b/yarn.lock
index d766da8..4686af7 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1597,10 +1597,10 @@
rambda "^6.7.0"
react-select "^5.2.2"
-"@lingdocs/ps-react@^7.1.6":
- version "7.1.6"
- resolved "https://npm.lingdocs.com/@lingdocs/ps-react/-/ps-react-7.1.6.tgz#610f543e5a82acbdb346026ea0bceb4a78febf21"
- integrity sha512-IQf3X5uBvBbuhE2Q3/66rU7bVOeSg81rdPvvYgNCWDFk0fAM5VqV7mJSpRkMBM3foV9rlNk6F0WkNqG/ngp6IQ==
+"@lingdocs/ps-react@^7.1.7":
+ version "7.1.7"
+ resolved "https://npm.lingdocs.com/@lingdocs/ps-react/-/ps-react-7.1.7.tgz#69c552322919d16afb5f1635e2b928e38761fc5f"
+ integrity sha512-yMKzcKnBQUgOsMZLAVKhBjpG5QzGC5nBEixtpj4PRVtjIs34HqwdxDxWPA0/OYZVNUvFhFui4UM3oZ+T568k9Q==
dependencies:
"@formkit/auto-animate" "^1.0.0-beta.3"
classnames "^2.2.6"