littlecodersh / translation Goto Github PK
View Code? Open in Web Editor NEWPython translation package
License: Other
Python translation package
License: Other
都可以在这里交流,我会及时回复的~
The default example fails with
In [6]: print(baidu('hello world!', dst = 'ru'))
---------------------------------------------------------------------------
TranslateError Traceback (most recent call last)
<ipython-input-6-62aeea8f76b9> in <module>()
----> 1 print(baidu('hello world!', dst = 'ru'))
/home/chillaranand/.virtualenvs/py35/lib/python3.5/site-packages/translation/__init__.py in baidu(text, src, dst, proxies)
26 def baidu(text, src = None, dst = None, proxies = None):
27 return t.get(text, default = 'baidu', src = src,
---> 28 dst = dst, proxies = proxies)
29 def bing(text, src = None, dst = None, proxies = None):
30 return t.get(text, default = 'bing', src = src,
/home/chillaranand/.virtualenvs/py35/lib/python3.5/site-packages/translation/main.py in get(self, text, default, src, dst, proxies)
31 test_proxies(proxies, default)
32 r = TRANSLATION_DICT[default](text, src, dst, proxies)
---> 33 if r == '': raise TranslateError('No translation get, you may retry')
34 return r
35 def get_all(self, text, default = None, src = None,
TranslateError: No translation get, you may retry
Hi,
Can you explain how exactly can I use translation module in Python?
Bing translator not working from last few days, getting error
translation.exception.TranslateError: No translation get, you may retry
你好!
我试了这段code:
from translation import google, ConnectError
try:
print(google('hello world!', dst = 'zh-CN', proxies = {'http': '127.0.0.1:1080'}))
except ConnectError:
print('Invaild proxy')
但是总是出现ConnectionRefusedError。请问是为什么呢?proxy 不对吗?
我试这段
from translation import baidu, google, youdao, iciba
print(google('hello world!', dst = 'zh-CN'))
print(google('hello world!', dst = 'ru'))
print(baidu('hello world!', dst = 'zh'))
print(baidu('hello world!', dst = 'ru'))
print(youdao('hello world!', dst = 'zh-CN'))
print(iciba('hello world!', dst = 'zh'))
print(bing('hello world!', dst = 'zh-CHS'))
则出现TranslateError, 您知道为什么吗?
提前感谢您的回答!
求google翻译的功能
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.