Skip to content
This repository has been archived by the owner on Feb 9, 2023. It is now read-only.

Commit

Permalink
fix unicode bug
Browse files Browse the repository at this point in the history
  • Loading branch information
windreamer committed Jul 26, 2012
1 parent 2575c23 commit f19706e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pinyin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ def get_pinyin(self, text):
text = text.encode("utf-8", 'ignore')
wl = mmseg.seg_txt(text)
pyl = [zh_cn.match(wz.decode("utf-8",'ignore'))
and self._pinyin(wz) or wz.decode('utf-8','ignore')
for wz in wl ]
and self._pinyin(wz) or [wz] for wz in wl ]
return map(lambda w:w.decode('utf-8', 'ignore'),
itertools.chain.from_iterable(pyl))

Expand Down

0 comments on commit f19706e

Please sign in to comment.