Skip to main content

A library to convert variant Chinese characters to standard simplified or traditional characters.

Project description

Image

Chinese Character Variant Converter,

an open-source library for converting Chinese character variants to standard simplified or traditional characters.

*If you're curious about our name and logo: 'CHAR' comes from 'Chinese character variant' and also refers to a type of beautiful fish with a gradient of red color (Arctic Char).

Install

pip install char-converter

Usage

Convert text

  1. Mode: one2one
from char_converter import CharConverter

text = '苟馀情其訫姱㠯练要兮,镸顑頷亦何伤。'

converter = CharConverter('v2t')
converted_text = converter.convert(text)
# 苟餘情其信姱以練要兮,長顑頷亦何傷。

converter = CharConverter('v2s')
converted_text = converter.convert(text)
# 苟余情其信姱以练要兮,长顑颔亦何伤。
  1. Mode: one2many
from char_converter import CharConverter

text = '鈡𩄇毓秀'

converter = CharConverter('v2t')
converter.set_mode('one2many')
converted_text = converter.convert(text)
# 【鍾|鐘】靈毓秀

Convert file

from char_converter import CharConverter

converter = CharConverter('v2s')
converter.convert_file(input_file, output_file)

Data source

CBDB Project

OpenCC image

Dictionary of Variant Chinese Characters

General Standard Chinese Characters Table

Data filtering

Image

Contributors

Yuqi Chen (data collection and programming)

Hongsu Wang (project manager)

Yiyi Wang (proofreading), Fengyi Ji (data collection)

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

char_converter-0.37.tar.gz (84.0 kB view details)

Uploaded Source

Built Distribution

char_converter-0.37-py3-none-any.whl (81.2 kB view details)

Uploaded Python 3

File details

Details for the file char_converter-0.37.tar.gz.

File metadata

  • Download URL: char_converter-0.37.tar.gz
  • Upload date:
  • Size: 84.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for char_converter-0.37.tar.gz
Algorithm Hash digest
SHA256 c05bf36bcceb3b2b5878d2f460ef9fd392032cbcadd23968bc514335587d729c
MD5 9326a8420e9e25aa9360940d5647ce6b
BLAKE2b-256 f2652f89267c50535f20b685884363fceff2cd22a0f7b019610c8798c8bc754b

See more details on using hashes here.

File details

Details for the file char_converter-0.37-py3-none-any.whl.

File metadata

File hashes

Hashes for char_converter-0.37-py3-none-any.whl
Algorithm Hash digest
SHA256 fbdff95ef4d9bf6ef1133495d80d5b302b078c147dca7d881e385df0d1720276
MD5 ea4560d667d169bdd99eb686c0ea5043
BLAKE2b-256 c63aa9ba514fd0391994f18807dd9168a3c40f6099316d7b30aed0c7765c4460

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