import parse import dbconnector def translatesent(sent, lang):
sent = parse.parsesent(sent) for word in sent: if word["word"]["id"]!= 0:
word["translated"] = dbconnector.translate(word["word"]["id"],lang) else:
word["translated"] = word["word"]["navi"] return sent