Skip to content

Commit

Permalink
Add support for verbal nouns.
Browse files Browse the repository at this point in the history
  • Loading branch information
fniessink committed Dec 14, 2024
1 parent 29ceb68 commit de259cf
Show file tree
Hide file tree
Showing 21 changed files with 171 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
### Added

- Allow for selecting quiz types to use via the command-line interface. Closes [#318](https://github.com/fniessink/toisto/issues/318).
- Add support for verbal nouns (fourth infinitive in Finnish).

## 0.33.2 - 2024-12-04

Expand Down
22 changes: 22 additions & 0 deletions docs/software.md
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,28 @@ When concepts are verbs, infinitives can be specified as follows:
}
```

### Verbal nouns

When concepts are verbs, verbal nouns (fourth infinitive in Finnish) can be specified as follows:

```json
{
"to ask": {
"infinitive": {
"en": "to ask",
"fi": "kysyä",
"nl": "vragen"
},
"verbal noun": {
"en": "asking",
"fi": "kysyminen",
"nl": "het vragen"
},
"singular": "..."
}
}
```

### Tenses

When concepts are verbs, the present tense, past tense, present perfect, and past perfect tense can be specified as follows:
Expand Down
1 change: 1 addition & 0 deletions src/concepts/adjectives/important.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"important": {
"example": "sleeping is important",
"positive degree": {
"en": "important",
"fi": "tärkeä",
Expand Down
5 changes: 5 additions & 0 deletions src/concepts/verbs/age.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
"fi": "vanheta;;vanheta is verbityypi 6",
"nl": "ouder worden"
},
"verbal noun": {
"en": "aging",
"fi": "vanheneminen",
"nl": "het ouder worden"
},
"singular": {
"first person": {
"en": "I age",
Expand Down
5 changes: 5 additions & 0 deletions src/concepts/verbs/appreciate.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"fi": "arvostaa",
"nl": "waarderen"
},
"verbal noun": {
"en": "appreciating",
"fi": "arvostaminen",
"nl": "het waarderen"
},
"singular": {
"first person": {
"en": "I appreciate",
Expand Down
5 changes: 5 additions & 0 deletions src/concepts/verbs/arrive.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"fi": "saapua",
"nl": "aankomen"
},
"verbal noun": {
"en": "arriving",
"fi": "saapuminen",
"nl": "het aankomen"
},
"singular": {
"first person": {
"en": "I arrive",
Expand Down
7 changes: 6 additions & 1 deletion src/concepts/verbs/ask.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"fi": "kysyä",
"nl": "vragen"
},
"verbal noun": {
"en": "asking",
"fi": "kysyminen",
"nl": "het vragen"
},
"singular": {
"first person": {
"en": "I ask",
Expand Down Expand Up @@ -46,4 +51,4 @@
}
}
}
}
}
5 changes: 5 additions & 0 deletions src/concepts/verbs/choose.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"fi": "valita;;valita is verbityyppi 5",
"nl": "kiezen"
},
"verbal noun": {
"en": "choosing",
"fi": "valitseminen",
"nl": "het kiezen"
},
"present tense": {
"singular": {
"first person": {
Expand Down
5 changes: 5 additions & 0 deletions src/concepts/verbs/do.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"fi": "tehdä;;tehdä is verbityyppi 2",
"nl": "doen"
},
"verbal noun": {
"en": "doing",
"fi": "tekeminen",
"nl": "het doen"
},
"singular": {
"first person": {
"en": "I do",
Expand Down
63 changes: 63 additions & 0 deletions src/concepts/verbs/drink.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,68 @@
{
"to dtink": {
"infinitive": {
"en": "to drink",
"fi": "juoda",
"nl": "drinken"
},
"verbal noun": {
"en": "drinking",
"fi": "juominen",
"nl": "het drinken"
},
"singular": {
"first person": {
"en": "I drink",
"fi": "minä juon",
"nl": "ik drink"
},
"second person": {
"en": "you drink",
"fi": "sinä juot",
"nl": "jij drinkt"
},
"third person": {
"fi": "hän juo",
"feminine": {
"en": "she drinks",
"nl": "zij drinkt"
},
"masculine": {
"en": "he drinks",
"nl": "hij drinkt"
}
}
},
"plural": {
"first person": {
"en": "we drink",
"fi": "me juomme",
"nl": "wij drinken"
},
"second person": {
"en": "you drink",
"fi": "te juotte",
"nl": "jullie drinken"
},
"third person": {
"en": "they drink",
"fi": "he juovat",
"nl": "zij drinken"
}
}
},
"to drink coffee": {
"roots": {
"en": [
"to drink",
"coffee"
],
"fi": "coffee",
"nl": [
"to drink",
"coffee"
]
},
"infinitive": {
"en": "to drink coffee",
"fi": "käydä kahvi",
Expand Down
5 changes: 5 additions & 0 deletions src/concepts/verbs/eat.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"fi": "syödä;;syödä is verbityyppi 2",
"nl": "eten"
},
"verbal noun": {
"en": "eating",
"fi": "syöminen",
"nl": "het eten"
},
"present tense": {
"singular": {
"first person": {
Expand Down
5 changes: 5 additions & 0 deletions src/concepts/verbs/give.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"fi": "antaa;;antaa is verbityypi 1",
"nl": "geven"
},
"verbal noun": {
"en": "giving",
"fi": "antaminen",
"nl": "het geven"
},
"singular": {
"first person": {
"en": "I give",
Expand Down
7 changes: 6 additions & 1 deletion src/concepts/verbs/look.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"fi": "katsoa",
"nl": "kijken"
},
"verbal noun": {
"en": "looking",
"fi": "katsominen",
"nl": "het kijken"
},
"present tense": {
"singular": {
"first person": {
Expand Down Expand Up @@ -90,4 +95,4 @@
}
}
}
}
}
7 changes: 6 additions & 1 deletion src/concepts/verbs/meet.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
"en": "to meet;come face to face with",
"fi": "tavata",
"nl": "ontmoeten"
},
"verbal noun": {
"en": "meeting",
"fi": "tapaaminen",
"nl": "het ontmoeten"
}
}
}
}
5 changes: 5 additions & 0 deletions src/concepts/verbs/read.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"fi": "lukea;;lukea is verbityyppi 1",
"nl": "lezen"
},
"verbal noun": {
"en": "reading",
"fi": "lukeminen",
"nl": "het lezen"
},
"present tense": {
"singular": {
"first person": {
Expand Down
5 changes: 5 additions & 0 deletions src/concepts/verbs/see.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"fi": "nähdä;;nähdä is verbityyppi 2",
"nl": "zien"
},
"verbal noun": {
"en": "seeing",
"fi": "näkeminen",
"nl": "het zien"
},
"singular": {
"first person": {
"en": "I see",
Expand Down
16 changes: 16 additions & 0 deletions src/concepts/verbs/sleep.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
{
"to sleep": {
"example": "sleeping is important",
"infinitive": {
"en": "to sleep",
"fi": "nukkua;;nukkua is verbityypi 1",
"nl": "slapen"
},
"verbal noun": {
"en": "sleeping",
"fi": "nukkuminen",
"nl": "het slapen"
},
"present tense": {
"singular": {
"first person": {
Expand Down Expand Up @@ -89,5 +95,15 @@
}
}
}
},
"sleeping is important": {
"roots": [
"to sleep",
"to be",
"important"
],
"en": "Sleeping is important.",
"fi": "Nukkuminen on tärkeää.",
"nl": "Slapen is belangrijk."
}
}
2 changes: 1 addition & 1 deletion src/toisto/model/language/grammar.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from typing import Literal

GrammaticalGender = Literal["feminine", "masculine", "neuter"]
GrammaticalNumber = Literal["infinitive", "singular", "plural"]
GrammaticalNumber = Literal["infinitive", "verbal noun", "singular", "plural"]
GrammaticalPerson = Literal["first person", "second person", "third person"]
DegreeOfComparison = Literal["positive degree", "comparative degree", "superlative degree"]
Diminutive = Literal["root", "diminutive"]
Expand Down
1 change: 1 addition & 0 deletions src/toisto/model/quiz/quiz_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ def question_notes_applicable(self, question: Label, answer: Label) -> bool:
PRESENT_PERFECT_TENSE = GrammaticalQuizType("present perfect tense")
PAST_PERFECT_TENSE = GrammaticalQuizType("past perfect tense")
INFINITIVE = GrammaticalQuizType("infinitive")
VERBAL_NOUN = GrammaticalQuizType("verbal noun")
POSITIVE_DEGREE = GrammaticalQuizType("positive degree")
COMPARATIVE_DEGREE = GrammaticalQuizType("comparative degree")
SUPERLATIVE_DEGREE = GrammaticalQuizType("superlative degree")
Expand Down
2 changes: 2 additions & 0 deletions tests/toisto/model/quiz/test_quiz.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
SINGULAR,
SUPERLATIVE_DEGREE,
THIRD_PERSON,
VERBAL_NOUN,
WRITE,
)
from toisto.persistence.spelling_alternatives import load_spelling_alternatives
Expand Down Expand Up @@ -222,6 +223,7 @@ def test_instructions(self):
SECOND_PERSON: "Give the [underline]second person[/underline] in Finnish",
THIRD_PERSON: "Give the [underline]third person[/underline] in Finnish",
INFINITIVE: "Give the [underline]infinitive[/underline] in Finnish",
VERBAL_NOUN: "Give the [underline]verbal noun[/underline] in Finnish",
PRESENT_TENSE: "Give the [underline]present tense[/underline] in Finnish",
PAST_TENSE: "Give the [underline]past tense[/underline] in Finnish",
PRESENT_PERFECT_TENSE: "Give the [underline]present perfect tense[/underline] in Finnish",
Expand Down
2 changes: 1 addition & 1 deletion tests/toisto/ui/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
feminine, first person, full form, imperative, infinitive, interpret, interrogative,
masculine, negative, neuter, order, ordinal, past perfect tense, past tense, plural, positive
degree, present perfect tense, present tense, read, second person, singular, superlative
degree, third person, write"""
degree, third person, verbal noun, write"""


class ParserTest(unittest.TestCase):
Expand Down

0 comments on commit de259cf

Please sign in to comment.