Generate compositions, supercompositions and variants for a given Hanzi / Kanji
Project description
CJKradlib
Generate compositions, supercompositions and variants for a given Hanzi / Kanji, based on cjkvi-ids. (Previously, cjk-decomp.)
Installation
pip install cjkradlib
Also, IDS sequences use full range of CJK ideographs, so the fonts that covers all encoded ideographs (such as HanaMin or Hanamin AFDKO ) should be used.
Usage
from cjkradlib import RadicalFinder
finder = RadicalFinder(lang='zh') # default is 'zh'
result = finder.search('麻')
print(result.compositions) # ['广', '林']
print(result.supercompositions) # ['摩', '魔', '磨', '嘛', '麽', '靡', '糜', '麾']
print(result.variants) # ['菻']
Supercompositions are based on the character frequency in each language, so altering the language give slightly different results.
from cjkradlib import RadicalFinder
finder = RadicalFinder(lang='jp')
result = finder.search('麻')
print(result.supercompositions) # ['摩', '磨', '魔', '麿']
Related projects
Plan
- Use https://github.com/cjkvi/cjkvi-ids as the source for CJK-decomposition.
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
cjkradlib-0.1.2.tar.gz
(1.7 MB
view details)
Built Distribution
File details
Details for the file cjkradlib-0.1.2.tar.gz
.
File metadata
- Download URL: cjkradlib-0.1.2.tar.gz
- Upload date:
- Size: 1.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/0.11.5 CPython/3.7.0 Darwin/17.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92257e014dbef1ff8a2263ed46fbdf0d626ed5d56c5c4bc4177a685cfcef16cc |
|
MD5 | f504d3d63a23573547f0f172636fe3b5 |
|
BLAKE2b-256 | 86c10727cabcd0c7b4c44e49d6faf8d8db1b4d3bad8ebf27fabf773aa0f1559c |
File details
Details for the file cjkradlib-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: cjkradlib-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/0.11.5 CPython/3.7.0 Darwin/17.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e09034360d02c1798af125156305f69ce3ac824cf3db6c6c1b646a1437a3b701 |
|
MD5 | 39ed8765d8c0ad26983a20524888aef6 |
|
BLAKE2b-256 | efaacc00c19758033cc12ff0e83496ab340a14fa2bec3de79fab2f99be9e51ad |