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.

* About the project's 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).

Online Demo

Char Converter Demo

Python

Install

pip install char-converter

Update

Important Note: We have been checking and updating the data from time to time. Please run the following command to ensure the package is the latest version before using it to handle important mateirals every time.

pip install char-converter -U

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)

Kaini Xiong (proofreading)

License

License: CC BY-SA 4.0

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

Uploaded Source

Built Distribution

char_converter-0.40-py3-none-any.whl (158.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: char_converter-0.40.tar.gz
  • Upload date:
  • Size: 2.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for char_converter-0.40.tar.gz
Algorithm Hash digest
SHA256 d33ae33cdcf5054e1996b73e2e33333f8015850d01ad1737528351b4fe755511
MD5 a426c23922f11ac37a764fd2c3b29e70
BLAKE2b-256 646ecd83f5e8407db0ef9253a4d82b3b71339b23a17af960126aed03542ca26e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for char_converter-0.40-py3-none-any.whl
Algorithm Hash digest
SHA256 c61d40dbc6605297f9be125103f1fb82e9a139dd4d6736ac54556a9c828906a5
MD5 a82fb2b74591628e154e4ac4ec2806eb
BLAKE2b-256 17244e6c99386f48b9d2455d5c936efe1c002a1d1070a88510f78667f7c5efa2

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