Skip to main content

Smart Chinese-to-Pinyin converter.

Project description

Pinyin

Smart Chinese-to-Pinyin converter.

Getting Started

pip install smart_pinyin

Usage

>>> from pinyin import Pinyin
>>> pinyin = Pinyin()
>>> ' '.join(p.get_pinyin('银行行长潘玮柏长了一头乌黑的白发, 睡觉睡的很晚, 道行很深', failure=''))
>>> u'yin hang hang zhang pan wei bo zhang le yi tou wu hei de bai fa  shui jiao shui de hen wan   dao heng hen shen'
>>> for i in pinyin.get_pinyin_all('自行车'): print list(i)
[u'zi', u'hang', u'che']
[u'zi', u'hang', u'ju']
[u'zi', u'heng', u'che']
[u'zi', u'heng', u'ju']
[u'zi', u'xing', u'che']
[u'zi', u'xing', u'ju']

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for smart_pinyin, version 0.3.1
Filename, size File type Python version Upload date Hashes
Filename, size smart_pinyin-0.3.1.tar.gz (144.9 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page