1

Python3 の unidecode ライブラリを使用して、ロシア語 (キリル文字) のアクセントを削除しようとしています。unidecode lib は、他の例では正常に機能しますが、ロシア語の単語では機能しません。どんな助けでも大歓迎です。

「e」文字のアクセントを削除する代わりに、ロシア語は「ND3/4D3/4D+-NDuID1/2D,N」になり、これは私たちが望んでいるものではありません...

Python 3.3.0 (default, Oct 24 2012, 14:30:03)
[GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> # -*- coding: utf-8 -*-
...
>>> from unidecode import unidecode
>>> print(unidecode(u"Cœur"))
CAur
>>> print(unidecode(u"сообще́ния"))
ND3/4D3/4D+-NDuID1/2D,N
>>>
4

1 に答える 1

1

Mac OSXで試してみました。

$ echo $LANG
en_US.utf-8
$ python3
Python 3.3.2 (default, Aug 22 2013, 12:33:42)
[GCC 4.2.1 Compatible Apple Clang 4.0 ((tags/Apple/clang-421.0.60))] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from unidecode import unidecode
>>> print(unidecode(u"Cœur"))
Coeur
>>> print(unidecode(u"сообще́ния"))
soobshcheniia

LANG 変数を設定してみてください。

于 2013-09-30T16:57:13.033 に答える