Ale*_*lex 4 python translation nlp nltk
我需要找到一种方法将某些语言的单词(转换后的)重写为英语。例如,??????
(俄语)听起来像privet
(英语)。
含义和语法无关紧要,但是我希望它具有更相似的发音。一切都应该使用Python,我努力地在互联网上查找并且没有找到好的方法。
例如,类似于以下内容:
translit("?? ?? ????????", "ru") = juu so beutiful
translit("???", "ru") = kar
Run Code Online (Sandbox Code Playgroud)
也许您应该尝试unidecode:
>>> import unidecode
>>> unidecode.unidecode("?? ?? ????????")
'iuu so beutiful'
>>> unidecode.unidecode("die größten Probleme")
'die grossten Probleme'
>>> unidecode.unidecode("Avec Éloïse, ils président à l'assemblée")
"Avec Eloise, ils president a l'assemblee"
Run Code Online (Sandbox Code Playgroud)
用安装pip
:
pip3 install unidecode
Run Code Online (Sandbox Code Playgroud)