Skip to content

Commit

Permalink
Fixed and added to verbs feature
Browse files Browse the repository at this point in the history
  • Loading branch information
kyletimmermans committed Feb 28, 2024
1 parent d07b9dc commit cfdfbab
Show file tree
Hide file tree
Showing 3 changed files with 166 additions and 6 deletions.
Binary file added .DS_Store
Binary file not shown.
14 changes: 8 additions & 6 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ const randomCase = (animate, plural) => {

const randomVerb = (data) => {
let randomVerb = data.verb[getRandomInt(0, data.verb.length - 1)];

// 60% present, 30% past, 10% imperative
let conjType = getRandomString([
"present",
Expand All @@ -152,6 +153,7 @@ const randomVerb = (data) => {
"past",
"imperative",
]);

let proNoun;

if (conjType == "imperative") {
Expand All @@ -160,6 +162,12 @@ const randomVerb = (data) => {
proNoun = getRandomString(["m", "f", "n", "p"]);
} else {
proNoun = getRandomString(["ya", "ty", "on", "my", "vy", "oni"]);

// There is rarely present tense use of быть
// Use its future tense instead when present chosen
if (randomVerb.name == "быть") {
conjType = "future";
}
}

let cyrillicPronoun;
Expand Down Expand Up @@ -348,9 +356,6 @@ const verb = () => {
fetchList.push("verb");
// Possibly no data like present tense быть
let q = randomVerb(jsonVerb);
while (q[3] == "-") {
q = randomVerb(jsonVerb);
}
document.getElementById("question").innerHTML = q[2]+" ____ <b>"+q[0]
+"</b> (\""+q[4]+"\") ("
+q[1]+")";
Expand All @@ -360,9 +365,6 @@ const verb = () => {
// If already fetched
// Possibly no data like present tense быть
let q = randomVerb(jsonVerb);
while (q[3] == "-") {
q = randomVerb(jsonVerb);
}
document.getElementById("question").innerHTML = q[2]+" ____ <b>"+q[0]
+"</b> (\""+q[4]+"\") ("
+q[1]+")";
Expand Down
158 changes: 158 additions & 0 deletions wordbank/verbs.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
"imperative": {
"ty": "Будь",
"vy": "Будьте"
},
"future": {
"ya": "буду",
"ty": "будешь",
"on": "будет",
"my": "будем",
"vy": "будете",
"oni": "будут"
}
}
},
Expand Down Expand Up @@ -2799,6 +2807,156 @@
"vy": "Смейтесь"
}
}
},
{
"name": "встретиться",
"translation": "to meet",
"form": "perfective",
"conjugations": {
"present": {
"ya": "встречусь",
"ty": "встретишься",
"on": "встретится",
"my": "встретимся",
"vy": "встретитесь",
"oni": "встретятся"
},
"past": {
"m": "встретился",
"f": "встретилась",
"n": "встретилось",
"p": "встретились"
},
"imperative": {
"ty": "Встреться",
"vy": "Встретьтесь"
}
}
},
{
"name": "встречаться",
"translation": "to meet",
"form": "imperfective",
"conjugations": {
"present": {
"ya": "встречаюсь",
"ty": "встречаешься",
"on": "встречается",
"my": "встречаемся",
"vy": "встречаетесь",
"oni": "встречаются"
},
"past": {
"m": "встречался",
"f": "встречалась",
"n": "встречалось",
"p": "встречались"
},
"imperative": {
"ty": "Встречайся",
"vy": "Встречайтесь"
}
}
},
{
"name": "переезжать",
"translation": "to move (change homes)",
"form": "imperfective",
"conjugations": {
"present": {
"ya": "переезжаю",
"ty": "переезжаешь",
"on": "переезжает",
"my": "переезжаем",
"vy": "переезжаете",
"oni": "переезжают"
},
"past": {
"m": "переезжал",
"f": "переезжала",
"n": "переезжало",
"p": "переезжали"
},
"imperative": {
"ty": "Переезжай",
"vy": "Переезжайте"
}
}
},
{
"name": "переехать",
"translation": "to move (change homes)",
"form": "perfective",
"conjugations": {
"present": {
"ya": "перееду",
"ty": "переедешь",
"on": "переедет",
"my": "переедем",
"vy": "переедете",
"oni": "переедут"
},
"past": {
"m": "переехал",
"f": "переехала",
"n": "переехало",
"p": "переехали"
},
"imperative": {
"ty": "Переезжай",
"vy": "Переезжайте"
}
}
},
{
"name": "искать",
"translation": "to look / search for",
"form": "imperfective",
"conjugations": {
"present": {
"ya": "ищу",
"ty": "ищешь",
"on": "ищет",
"my": "ищем",
"vy": "ищете",
"oni": "ищут"
},
"past": {
"m": "искал",
"f": "искала",
"n": "искало",
"p": "искали"
},
"imperative": {
"ty": "Ищи",
"vy": "Ищите"
}
}
},
{
"name": "войти",
"translation": "to enter / to come in",
"form": "perfective",
"conjugations": {
"present": {
"ya": "войду",
"ty": "войдёшь",
"on": "войдёт",
"my": "войдём",
"vy": "войдёте",
"oni": "войдут"
},
"past": {
"m": "вошёл",
"f": "вошла",
"n": "вошло",
"p": "вошли"
},
"imperative": {
"ty": "Войди",
"vy": "Войдите"
}
}
}
]
}

0 comments on commit cfdfbab

Please sign in to comment.