-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconjugator.py
34 lines (27 loc) · 969 Bytes
/
conjugator.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import conjugator_utils as conjutils
############## MAIN PROGRAM ####################
irregular_verbs = conjutils.get_irregular_verbs()
concrete_verbs = conjutils.get_concrete_verbs()
prefixes = conjutils.get_prefixes()
while(1):
word = input("enter a verb infinitive (or 'q' to quit): ")
if word == "q":
break
matches = conjutils.find_verb_matches(word, irregular_verbs)
(not_root, root) = conjutils.get_prefix(word, prefixes)
is_concrete = conjutils.is_concrete_verb(word, concrete_verbs)
# TODO: determine if perfective
is_perfective = False
verb = None
verb2 = None
if matches != []:
(verb, verb2) = conjutils.disambiguate_verb(matches, word, root, is_concrete, is_perfective)
if not verb:
verb = conjutils.determine_verb_class(word, root, is_concrete, is_perfective)
if verb:
verb.conjugate()
# TODO: display the conjugation (prettily)
print(verb.get_table())
if verb2 is not None:
verb2.conjugate()
print(verb2.get_table())