How google translate works algorithm python