diff options
author | Eddy Pedroni <eddy@0xf7.com> | 2022-10-18 19:29:06 +0200 |
---|---|---|
committer | Eddy Pedroni <eddy@0xf7.com> | 2022-10-18 19:29:06 +0200 |
commit | 0d07220aeceae94fc05b12c4c98bec9ee28026b4 (patch) | |
tree | 1d9f8a57031c3d959faf1c48881e87a1fdfae081 /kasus.py | |
parent | 31639b35e17732cf4c543194ec6d830da0178540 (diff) |
MVP done
Diffstat (limited to 'kasus.py')
-rw-r--r-- | kasus.py | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -1,16 +1,16 @@ from colorama import Fore, Back, Style +import readline -import query import solver total = 0 correct = 0 while True: - case, article, number, adjective, noun = query.get() + query, solution = solver.get() - parameters = f"{Fore.MAGENTA}{case}, {Fore.BLUE}{article}, {Fore.YELLOW}{number}{Style.RESET_ALL}" - queryString = f"{noun}, {adjective}" + parameters = f"{Fore.MAGENTA}{query.case}, {Fore.BLUE}{query.article}, {Fore.YELLOW}{query.cardinality}{Style.RESET_ALL}" + queryString = f"{query.noun['nom-sin']}, {query.adjective}" total += 1 print(f"{Style.BRIGHT}--- Übung {total} ---{Style.NORMAL}") @@ -20,14 +20,13 @@ while True: response = input("> ") - solution = solver.solve(case, article, number, adjective, noun) print(f"{Style.BRIGHT}", end="") - if response == solution: + if solution.evaluate(response): correct += 1 print(f"{Fore.GREEN}Richtig ({correct}/{total})") else: - print(f"{Fore.RED}Falsch ({correct}/{total}):{Style.RESET_ALL} {solution}") + print(f"{Fore.RED}Falsch ({correct}/{total}):{Style.RESET_ALL} {solution.full}, {solution.noun}") print(f"{Style.RESET_ALL}") |