Exemplo n.º 1
0
def getSentence( role, verb, item ):
    verbRole = buildVerb.getVerbAndRole( role, verb )
    itemDetails = words.get( item, None )
    if itemDetails is None:
        word, gender = "table", "le"
    else:
        word, gender = itemDetails[ singular ] 
    french = "%s %s %s" % ( verbRole[ 0 ], gender, word, )
    english = "%s %s" % ( verbRole[ 1 ], item, )
    return french, english
Exemplo n.º 2
0
def verbRoleFrench( params, trys = 3 ):
    verb, role = params
    french, english = buildVerb.getVerbAndRole( role, verb )
    print "What is the french for '%s'?" % ( english, )
    answerWord = input( "Answer> " )
    return answerWord == french, french
Exemplo n.º 3
0
verbs.update( verbsGroup2 )
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Regular verb roles. 
verb1Role = {
    "i" : ( "Je", "e", ),
    "you" : ( "tu", "es", ),
    "he" : ( "il", "e", ),
    "she" : ( "elle", "e", ),
    "we" : ( "nous", "ons", ), 
    "you(p)" : ( "vous", "ez", ),
    "they(m)" : ( "ils", "est", ),
    "they(f)" : ( "elles", "est", ),
}
# Regular verb roles. 
verb2Role = {
    "i" : ( "Je", "is", ),
    "you" : ( "tu", "is", ),
    "he" : ( "il", "it", ),
    "she" : ( "elle", "it", ),
    "we" : ( "nous", "essons", ), 
    "you(p)" : ( "vous", "essez", ),
    "they(m)" : ( "ils", "essent", ),
    "they(f)" : ( "elles", "essent", ),
}
verbRoles = verb1Role.keys()
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Main test.
if __name__ == "__main__":
    import buildVerb
    print buildVerb.getVerbAndRole( "she", "hate" )