PyDictionary translate() returns 无效单词 None
PyDictionary translate() returns Invalid Word None
我制作了以下名为 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'))
我收到了除
之外的所有内容的正确输出
print (dictionary.translate("Hello",'es')):
这是我的命令行输出:
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
我已经尝试了命令 dictionary.translate( "[word]", "[language_code]")
许多不同语言代码的不同单词,我不断得到每一对的输出:
Invalid Word
None
我也尝试过使用 PyDictionary github (http://github.com/geekpradd/PyDictionary)
中列出的用法 Web 服务
但我被定向到一个页面,上面写着(附有图片,网络 link 图片 link 名称):
内部服务器错误
服务器遇到内部错误,无法完成您的请求。要么是服务器过载,要么是应用程序出错。
http://pydictionary-geekpradd.rhcloud.com/api/translate/[code]/[word]
PyDictionary 使用 Google Translate 进行翻译,正如它用于访问 Google Translate 的模块的 PyPI page 中所述,Google 改变了一些东西来阻止这种情况. PyDictionary 翻译将不再有效。
我制作了以下名为 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'))
我收到了除
之外的所有内容的正确输出 print (dictionary.translate("Hello",'es')):
这是我的命令行输出:
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
我已经尝试了命令 dictionary.translate( "[word]", "[language_code]")
许多不同语言代码的不同单词,我不断得到每一对的输出:
Invalid Word
None
我也尝试过使用 PyDictionary github (http://github.com/geekpradd/PyDictionary)
中列出的用法 Web 服务但我被定向到一个页面,上面写着(附有图片,网络 link 图片 link 名称):
内部服务器错误
服务器遇到内部错误,无法完成您的请求。要么是服务器过载,要么是应用程序出错。
http://pydictionary-geekpradd.rhcloud.com/api/translate/[code]/[word]
PyDictionary 使用 Google Translate 进行翻译,正如它用于访问 Google Translate 的模块的 PyPI page 中所述,Google 改变了一些东西来阻止这种情况. PyDictionary 翻译将不再有效。