Skip to main content

Generate compositions, supercompositions and variants for a given Hanzi / Kanji

Project description

CJKradlib

Build Status PyPI version shields.io PyPI license PyPI pyversions

Generate compositions, supercompositions and variants for a given Hanzi / Kanji.

Installation

pip install cjkradlib

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

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.1.tar.gz (880.3 kB view details)

Uploaded Source

Built Distribution

cjkradlib-0.1.1-py3-none-any.whl (2.4 MB view details)

Uploaded Python 3

File details

Details for the file cjkradlib-0.1.1.tar.gz.

File metadata

  • Download URL: cjkradlib-0.1.1.tar.gz
  • Upload date:
  • Size: 880.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.11.5 CPython/3.7.0 Darwin/17.7.0

File hashes

Hashes for cjkradlib-0.1.1.tar.gz
Algorithm Hash digest
SHA256 bf1f01591aaa99ee405c4496dbd2c75e529f6328520dc49cfb5f24d51c72e618
MD5 caff4d42ff3c385c9fd39bfc4b9203b9
BLAKE2b-256 67b9c43926b1b8239885b82df4517a7b054bdbd22793c2e808f606e3b3458634

See more details on using hashes here.

File details

Details for the file cjkradlib-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: cjkradlib-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 2.4 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

Hashes for cjkradlib-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 46f93accaabadebca595845fdb5be4ef3d656960dc5968a32f9ac6ac235a6603
MD5 a0bffc1201cff58f5a87b283dcc1bc5f
BLAKE2b-256 d8174e7cec2a4b543915b0338481a382fc7cc5ef317b92650c348e516e551bf4

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