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

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

Uploaded Source

Built Distribution

char_converter-0.38-py3-none-any.whl (159.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: char_converter-0.38.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.38.tar.gz
Algorithm Hash digest
SHA256 7ad3fd0c54e61c5e7f55b9779b9f46faf4a19be07939700830a917b212d40c79
MD5 f7fd5a0f3e3728063173c52aeae79d25
BLAKE2b-256 fb46e28d093e8442db92a383b95f2b1d34940c167783dd609c80541672656360

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for char_converter-0.38-py3-none-any.whl
Algorithm Hash digest
SHA256 dda2b2add0cb880a8675588e467e5d984ec88a56a55cd43f8856f69bfe299f5d
MD5 fc4841483a7976ad6438d75cffe1306c
BLAKE2b-256 631530d3b696bfd40579fe62dcf34ffbbdd513ca5abcb7b008f709ae7de00b9d

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