Zhon
Zhon is a Python library that provides constants commonly used in Chinese text processing.
Documentation: https://tsroten.github.io/zhon/
GitHub: https://github.com/tsroten/zhon
Free software: MIT license
About
Zhon’s constants can be used in Chinese text processing, for example:
Find CJK characters in a string:
>>> re.findall('[{}]'.format(zhon.hanzi.characters), 'I broke a plate: 我打破了一个盘子.') ['我', '打', '破', '了', '一', '个', '盘', '子']Validate Pinyin syllables, words, or sentences:
>>> re.findall(zhon.pinyin.syllable, 'Yuànzi lǐ tíngzhe yí liàng chē.', re.I) ['Yuàn', 'zi', 'lǐ', 'tíng', 'zhe', 'yí', 'liàng', 'chē'] >>> re.findall(zhon.pinyin.word, 'Yuànzi lǐ tíngzhe yí liàng chē.', re.I) ['Yuànzi', 'lǐ', 'tíngzhe', 'yí', 'liàng', 'chē'] >>> re.findall(zhon.pinyin.sentence, 'Yuànzi lǐ tíngzhe yí liàng chē.', re.I) ['Yuànzi lǐ tíngzhe yí liàng chē.']
Features
Zhon includes the following commonly-used constants:
CJK characters and radicals
Chinese punctuation marks
Chinese sentence regular expression pattern
Pinyin vowels, consonants, lowercase, uppercase, and punctuation
Pinyin syllable, word, and sentence regular expression patterns
Zhuyin characters and marks
Zhuyin syllable regular expression pattern
CC-CEDICT characters
Getting Started
Contribute documentation, code, or feedback
Release files for zhon 2.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| zhon-2.1.1.tar.gz | 84.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| zhon-2.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 168.4 kB
Release files / zhon-2.1.1.tar.gz
| Download URL | zhon-2.1.1.tar.gz |
|---|---|
| Size | 84.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c8da424fad4aa698ddd3e1735515b49ff522c84dd1091e8fafd986ac7c6898f0
|
|
BLAKE2b-256 checksum How to use checksums |
2a8de6c8ee4df75940ddecb6f5e7b2753a9a3914e6cd357e7238987661723d81
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-httpx/0.27.2
|
Release files / zhon-2.1.1-py3-none-any.whl
| Download URL | zhon-2.1.1-py3-none-any.whl |
|---|---|
| Size | 83.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9ec0d42229ae60708a045270f755ccefb48f2689f2a6ce0bc6597abf6c4a9871
|
|
BLAKE2b-256 checksum How to use checksums |
be13b8d6ca3a41bf5959bc3915678837385bf668162a7295140d81ccae0b96b7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-httpx/0.27.2
|