diff options
| author | Eddy Pedroni <eddy@0xf7.com> | 2022-10-18 21:02:31 +0200 | 
|---|---|---|
| committer | Eddy Pedroni <eddy@0xf7.com> | 2022-10-18 21:02:31 +0200 | 
| commit | 7bc31c0d156feb0cf07949a439b6d29fb07d6b45 (patch) | |
| tree | 1ad1494ee27248ff2c8d878adc0d8fb495200d55 /solver.py | |
| parent | 0d07220aeceae94fc05b12c4c98bec9ee28026b4 (diff) | |
Added common-nouns list, minor bugfixes
Diffstat (limited to 'solver.py')
| -rw-r--r-- | solver.py | 6 | 
1 files changed, 5 insertions, 1 deletions
@@ -48,14 +48,18 @@ def solve(query):      # full solution      decArt = tables.ARTICLES[query.article][query.case][gender] +          adjEnding = tables.ADJ_ENDINGS[query.article][query.case][gender] +    if adjEnding[0] == query.adjective[-1]: +        adjEnding = adjEnding[1:] +      decNoun = query.noun[nounKey]      # noun details      basicArt = tables.ARTICLES['bestimmter Artikel']['Nominativ'][gender]      basicNoun = query.noun[f"nom-{'plu' if query.cardinality == 'Plural' else 'sin'}"] -    if decNoun == "_": +    if decNoun == "—":          raise Exception("Invalid query")      return Solution(f"{decArt} {query.adjective}{adjEnding} {decNoun}".strip(),  | 
