A simple python script to translate chinese to pinyin based on Mandarin.dat
View the Project on GitHub lxyu/pinyin
Translate chinese chars to pinyin based on Mandarin.dat
$ pip install pinyin
>>> import pinyin >>> pinyin.get(u'你好') 'nihao' >>> pinyin.get_initial(u'你好') 'n h'