#!/usr/bin/env python
#
# Good site: http://german.about.com/library/blcase_sum.htm
# translating from english to german
# e.g. Accusative a good book
# should return ein gutes Buch
# Accusative a good man
# should return einen guten Mann

# Data flow is this: take English and find gender, number and gloss of noun.
# Use that plus  the case to get article and adjective.
# Combine together. 

# extend this to definite and to nominative and accusative (no plural)
# dictionary will extend to include words in the outline.
cases = {"AccusativeSingularIndefiniteMasculine" : "einen guten", 
"AccusativeSingularIndefiniteFeminine" : "eine gute", 
"AccusativeSingularIndefiniteNeuter" : "ein gutes"}

minidict = {"book" : ["Singular",  "Neuter", "Buch"], 
"man" : ["Singular", "Masculine", "Mann"], 
"woman" : ["Singular", "Feminine", "Frau"]}



ineng = input ("Please give me a case followed by a noun phrase, e.g., 'Accusative a good man'. ")
mywords = ineng.split(" ")
print(mywords) # all the words
noun = mywords[len(mywords) - 1] 
print(noun) # print just the noun

numbergenderword = minidict[noun]
print(numbergenderword) # print number, gender, word

determiner = 'Indefinite' # a or an
if mywords[1] == 'the': 
	determiner = 'Definite' # definite article the

prenoun = mywords[0] + numbergenderword[0] + determiner + numbergenderword[1] 
print(prenoun)

# just print this part:
germannoun = minidict[noun]
print(ineng)
print("is translated to: ")
print(cases[prenoun] + (" ") + germannoun[2])





