Skip to main content

Translate chinese word to bopomofo

Project description

https://img.shields.io/travis/antfu/bopomofo.svg?style=flat-square https://img.shields.io/codecov/c/github/antfu/bopomofo.svg?style=flat-square https://img.shields.io/codacy/grade/c5ae3c7ed15f4b388218f83cda6782f9.svg?style=flat-square https://img.shields.io/pypi/v/bopomofo.svg?style=flat-square https://img.shields.io/pypi/pyversions/bopomofo.svg?style=flat-square https://img.shields.io/pypi/status/bopomofo.svg?style=flat-square https://img.shields.io/pypi/l/bopomofo.svg?style=flat-square

Translate 漢字 to ㄅㄆㄇㄈ, based on lxneng/xpinyin.

Install

pip install bopomofo

Usage

>>> from bopomofo import to_bopomofo
>>> to_bopomofo(u'注音')
'ㄓㄨˋ ㄧㄣ'

>>> to_bopomofo(u'注音', tones=False)
'ㄓㄨ ㄧㄣ'

>>> to_bopomofo(u'注音', u'、')
'ㄓㄨˋ、ㄧㄣ'

>>> bopomofo.to_bopomofo(u'注音', first_tone_symbol=True)
'ㄓㄨˋ ㄧㄣˉ'

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 bopomofo, version 0.1.2
Filename, size File type Python version Upload date Hashes
Filename, size bopomofo-0.1.2-py2.py3-none-any.whl (5.5 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size bopomofo-0.1.2.tar.gz (5.1 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