Closed astromme closed 8 years ago
I'm trying to use dragonmapper to convert characters to pinyin, and I'm trying the tutorial but I'm stuck. http://dragonmapper.readthedocs.org/en/latest/tutorial.html
from dragonmapper import hanzi s = '这个字怎么念?' pinyin = hanzi.to_pinyin(s)
At this point pinyin is an empty string u''. What am I doing wrong?
pinyin
u''
Oh, I need to mark the string as unicode:
s = u'这个字怎么念?'
I'm trying to use dragonmapper to convert characters to pinyin, and I'm trying the tutorial but I'm stuck. http://dragonmapper.readthedocs.org/en/latest/tutorial.html
At this point
pinyin
is an empty stringu''
. What am I doing wrong?