Skip to main content

A Python library to split a Chinese Pinyin phrase into possible permutations of Chinese Pinyin words

Project description

This is a Python library for splitting a Chinese Pinyin phrase into possible permutations of valid Pinyin words.

Usage

Some examples of using the library are as follows:

>>> from pinyinsplit import PinyinSplit
>>> pys = PinyinSplit()
>>> pys.split('XiangGangDaXue')
[['Xiang', 'Gang', 'Da', 'Xue'], ['Xiang', 'Gang', 'Da', 'Xu', 'e'], ['Xi', 'ang', 'Gang', 'Da', 'Xue'], ['Xi', 'ang', 'Gang', 'Da', 'Xu', 'e']]
>>> pys.split('shediaoyingxiongchuan')
[['she', 'diao', 'ying', 'xiong', 'chuan'], ['she', 'diao', 'ying', 'xiong', 'chu', 'an'], ['she', 'di', 'ao', 'ying', 'xiong', 'chuan'], ['she', 'di', 'ao', 'ying', 'xiong', 'chu', 'an']]
>>> pys.split('shediaoyingxiongchuanxyz')
[]

Installation

You can install pinyinsplit as follows:

$ pip install pinyinsplit

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 pinyinsplit, version 0.1.4
Filename, size File type Python version Upload date Hashes
Filename, size pinyinsplit-0.1.4-py3-none-any.whl (4.2 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size pinyinsplit-0.1.4.tar.gz (3.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page