I am trying to translate 2 big documents from Spanish to English with this code: import goslate
big_files = ['lenin.txt', 'liga.txt']
gs = goslate.Goslate()
translation = []
for big_file in big_files:
with open(big_file, 'r') as f:
translated_lines = []
for line in f:
translated_line = gs.translate(line, "en")
translated_lines.append(translated_line)
translation.append('\n'.join(translated_lines))
I am getting this error:
File "C:\Anaconda\lib\urllib\request.py", line 590, in http_error_default raise HTTPError(req.full_url, code, msg, hdrs, fp)
HTTPError: Service Unavailable
A generally applicable thing to try when accessing web content through Python fails is accessing the web content through your browser to see if the problem lies in Python or somewhere else, such as your internet connection. Another even more generally applicable strategy is to Google whatever you're having trouble with. The first Google result for "goslate" return this:
https://pypi.python.org/pypi/goslate
I think that explains your problem.