A simple python script to translate chinese to pinyin based on Mandarin.dat
Translate chinese chars to pinyin based on Mandarin.dat
$ pip install pinyin
>>> import pinyin
>>> print pinyin.get('你 好')
nǐ hǎo
>>> print pinyin.get('你好', format="strip", delimiter=" ")
ni hao
>>> print pinyin.get('你好', format="numerical")
ni3hao3
>>> print pinyin.get_initial('你好')
n h
format must be one of: numerical/diacritical/strip