使用NLTK 3进行法语到英语的翻译

时间:2015-05-06 09:28:30

标签: python nltk

我正在使用NLTK 3,我已将英语单词翻译成法语:

>>> from nltk.corpus import wordnet as omw
>>> ss =  omw.synsets('dog')[0]
>>> ss.lemmas(lang='fre')
[Lemma('dog.n.01.chien'), Lemma('dog.n.01.canis_familiaris')]

但是,我无法做相反的事情,即将法语单词翻译成英语。有可能吗?

1 个答案:

答案 0 :(得分:2)

当我尝试Babelfish时,我不断收到此错误:

  

AttributeError:' module'对象没有属性'翻译'。

根据讨论的问题here

  

不再有http://babelfish.yahoo.com/translate_txt - 它会重定向到http://www.microsofttranslator.com/,这是另一个使用不同API的翻译服务。

并且,如果你查看官方文档here,就没有关于翻译的讨论。