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, 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

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.2.0.tar.gz (1.7 MB view details)

Uploaded Source

Built Distribution

cjkradlib-0.2.0-py3-none-any.whl (4.5 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cjkradlib-0.2.0.tar.gz
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.0a1 CPython/3.7.0 Darwin/17.7.0

File hashes

Hashes for cjkradlib-0.2.0.tar.gz
Algorithm Hash digest
SHA256 893f25e98cd3c0deea9d2857d4e20cddf1dfc84b7c7fbd2413a32e120ea4b7d0
MD5 f7b8ce7fba49e5e1f8cc2abc666456ce
BLAKE2b-256 546c2f9646d7bab672916d96d87da7c16674dfe7f92e05f827564c634fe48258

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cjkradlib-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.0a1 CPython/3.7.0 Darwin/17.7.0

File hashes

Hashes for cjkradlib-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b6e33534cdff4ae98a08482a523b40bd31e1251244261e97e544022d6b17a9bf
MD5 ff35c0ef324b4389d1a3d457d4e1ed89
BLAKE2b-256 04c1919fcc2b3d7a86d556a148322cf3a59be6ead62512d8a0dabba7b03089da

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