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(pinyin.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.

Source Distribution

smart_pinyin-0.4.6.tar.gz (145.0 kB view details)

Uploaded Source

File details

Details for the file smart_pinyin-0.4.6.tar.gz.

File metadata

  • Download URL: smart_pinyin-0.4.6.tar.gz
  • Upload date:
  • Size: 145.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/44.1.1 requests-toolbelt/0.10.1 tqdm/4.64.1 CPython/2.7.18

File hashes

Hashes for smart_pinyin-0.4.6.tar.gz
Algorithm Hash digest
SHA256 dffc8bcc5678a4a30b10b2b6c520430c860e0957d32a0c77b1726a0ac797f794
MD5 3199ba54df2381c9da0e0362df49cad3
BLAKE2b-256 4838d078319d15d1bf35b5264befb2bd6a1fcf13fd2c8934bad542f0ea722e8e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page