Reputation: 13
I made the following script called translate.py:
from PyDictionary import PyDictionary
dictionary=PyDictionary()
print (dictionary.meaning("indentation"))
print (dictionary.synonym("Life"))
print (dictionary.antonym("Life"))
print (dictionary.translate("Hello",'es'))
And I recieve the correct output for everything except
print (dictionary.translate("Hello",'es')):
Here is my command line output:
macintosh-3:reorder chibb9$ python translate.py
{u'Noun': ['a concave cut into a surface or edge (as in a coastline', 'the formation of small pits in a surface as a consequence of corrosion', 'the space left between the margin and the start of an indented line', 'the act of cutting into an edge with toothlike notches or angular incisions']}
[u'heart', u'growth', u'soul', u'activity', u'get-up-and-go']
[u'abstract', u'idleness', u'inactivity', u'laziness', u'lethargy']
Invalid Word
None
I have tried the command dictionary.translate( "[word]", "[language_code]")
many different words with different language codes and I keep getting this output for every pair:
Invalid Word
None
I have also tried using the usage web service listed on the PyDictionary github (http://github.com/geekpradd/PyDictionary)
But I get directed to a page that reads (picture attached, web link in image link name):
Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
http://pydictionary-geekpradd.rhcloud.com/api/translate/[code]/[word]
Upvotes: 1
Views: 2759
Reputation: 281177
PyDictionary uses Google Translate for translations, and as noted on the PyPI page of the module it uses to access Google Translate, Google changed things to stop this. PyDictionary translation will not work any more.
Upvotes: 1