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

Uploaded Source

Built Distribution

char_converter-0.39-py3-none-any.whl (158.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: char_converter-0.39.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.39.tar.gz
Algorithm Hash digest
SHA256 46de991ffcc4a92b9353d3a5be0a9f0c63a225b801d2b68fd75f06b5d7aebc86
MD5 9c30eb0658297b01c5884ee5f09f42d2
BLAKE2b-256 6a84d4d3456be011fd970efaccafa29454bc393920e022a710fcaaf3b4921c5e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for char_converter-0.39-py3-none-any.whl
Algorithm Hash digest
SHA256 5b4f665f67d4ae3af339e590d724118df156d9093be846619dc8a6b953298a0f
MD5 87e42b7b3ec81786028381bee1d6f0ec
BLAKE2b-256 e740042ae5bff713af483d5af8909bd3e8d61cd8839ec1cddc3d75f642fe009c

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