packages
package cjklib
-
check my post anaconda on mac
-
we can not use cjklib on osx-64 now
No packages found
in currentosx-64 channels
matching:cjklib
-
code snippet from www.codeitive.com
from cjklib.characterlookup import CharacterLookup source_file = 'input.txt' dest_file = 'output.txt' s = open(source_file, 'r') d = open(dest_file, 'w') cjk = CharacterLookup('T') for line in s: p = line.split('\t') for p_shard in p: for c in p_shard: readings = cjk.getReadingForCharacter(c.encode('utf-8'), 'Pinyin') d.write(readings[0].encode('utf-8')) d.write('\t') d.write('\n') s.close() d.close()
package pinyin
-
install form pypi source
$ cd pinyin-0.1.2 $ python setup.py install
-
code snippet
>>> import pinyin >>> pinyin.get_pinyin(u'你好') 'nihao' >>> pinyin.get_initial(u'你好') 'n h'
package hanzi2pinyin
-
we can not use cjklib on osx-64 now
No packages found
in currentosx-64 channels
matching:cjklib
-
install form pypi source
-
code snippet
>>> from hanzi2pinyin import hanzi2pinyin >>> hanzi2pinyin(u"你好") ... nihao
package Unidecode
-
install from pypi source
-
code snippet
from unidecode import unidecode print unidecode(u"\u5317\u4EB0") # That prints: Bei Jing