summaryrefslogtreecommitdiffstats
path: root/query.py
blob: c89b3a7dbd2417c8011723fdae3e768870e1a160 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import json
import random

CASES = ["Nominativ", "Akkusativ", "Dativ", "Genitiv"]
ARTICLES = ["bestimmter", "unbestimmter", "kein"]
CARDINALITIES = ["Singular"] * 3 + ["Plural"]

with open("adjectives.json", "r") as f:
    ADJECTIVES = json.load(f)

with open("nouns.json", "r") as f:
    NOUNS = json.load(f)

def get():
    case = random.choice(CASES)
    article = random.choice(ARTICLES)
    cardinality = random.choice(CARDINALITIES)
    adjective = random.choice(ADJECTIVES)
    noun = random.choice(NOUNS)

    return case, article, cardinality, adjective, noun