Just for laughs:
import urllib2
import urllib
import sys
import json
def translate(text,lang1,lang2):
base_url='http://ajax.googleapis.com/ajax/services/language/translate?'
langpair='%s|%s'%(lang1,lang2)
params=urllib.urlencode( (('v',1.0),
('q',text.encode('utf-8')),
('langpair',langpair),) )
url=base_url+params
content=urllib2.urlopen(url).read()
try:
trans_dict=json.loads(content)
except AttributeError:
try:
trans_dict=json.load(content)
except AttributeError:
trans_dict=json.read(content)
return trans_dict['responseData']['translatedText']
languages='de da nl zh-tw ko es pt el'.split()
text=(' '.join(sys.argv[1:])).decode('utf-8')
for lang in languages:
result=translate(text,'en',lang)
result=translate(result,lang,'en')
print(result)
print
Running
test.py "Hi, We have a requirement in which we need to change the words or phrases in the sentence while keeping its meaning intact."
yields
Hi, we have a commitment in which we
have to change the words or phrases in
a sentence while preserving its
meaning.
Hello, We have a requirement where we
need to change words or phrases in the
sentence while keeping its meaning
intact.
Hi, We have a requirement we need the
words or phrases within the meaning
while changing its meaning intact.
Hey, we have a requirement, we need to
change the word or phrase in the
sentence meaning, while maintaining
its integrity.
Hi, we maintain that we need to change
the word or phrase in the sentence
requirements have meant that
literally.
Hello, We have a requirement that we
must change the words or phrases in
the sentence, keeping intact its
meaning.
Hi, we have an obligation that we need
to change words or phrases in the
sentence, keeping intact its meaning.
Hello, We have a requirement where we
need to change the words or phrases in
the sentence, while keeping intact the
concept.