A Python library to split a Chinese Pinyin phrase into possible permutations of Chinese Pinyin words
Project description
pinyinsplit
===========
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:
.. doctest::
>>> 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')
[]
===========
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:
.. doctest::
>>> 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')
[]
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
pinyinsplit-0.1.1.tar.gz
(1.4 kB
view hashes)
Built Distribution
Close
Hashes for pinyinsplit-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38448dce521e6d7c2b2714ceda1df528ef3827c41b366ccd01da2abee55b2937 |
|
MD5 | 80a73048d578cb5bc5deecd06f3393f4 |
|
BLAKE2b-256 | bee2fcbc91be87a008088357dea860ec8b386fef1451d485d691368f2f16cbc5 |