Babelfish Translation from NLTK
As mentioned in the past, Babelfish Translatoin service seems no longer available.
>>> from nltk.misc import babelfish >>> babelfish.translate('cookbook', 'english', 'spanish') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python27\lib\site-packages\nltk\misc\babelfish.py", line 100, in tran slate raise BabelizerIOError("Couldn't talk to server: %s" % what) nltk.misc.babelfish.BabelizerIOError: Couldn't talk to server: [Errno socket err or] [Errno 11004] getaddrinfo failed >>> >>> babelfish.available_languages ['Chinese', 'English', 'French', 'German', 'Greek', 'Italian', 'Japanese', 'Kore an', 'Portuguese', 'Russian', 'Spanish']
In stead, I found a source code in http://nltk.org/_modules/nltk/misc/babelfish.html
... try: response = urllib.urlopen('http://babelfish.yahoo.com/translate_txt', params) except IOError as what: raise BabelizerIOError("Couldn't talk to server: %s" % what) ...
The url does not exist then return the error message.