Translate chinese chars to pinyin based on Mandarin.dat
Project description
Translate chinese chars to pinyin based on Mandarin.dat
Install
$ pip install pinyin
Usage
>>> 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pinyin-0.3.1.tar.gz
(126.6 kB
view hashes)