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.

Install

pip install char-converter

Usage

Convert text

from char_converter import CharConverter

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

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

converter = CharConverter('v2s')
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

Contributor

Yuqi Chen (data collection and programing)

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.36.tar.gz (83.5 kB view details)

Uploaded Source

Built Distribution

char_converter-0.36-py3-none-any.whl (80.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: char_converter-0.36.tar.gz
  • Upload date:
  • Size: 83.5 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.36.tar.gz
Algorithm Hash digest
SHA256 fab309324e2ee6cdf811f30119d8036bcac5a1c4e9ab2c262da47fb10be8e560
MD5 a4648bb5f8b33e6bb125bdf23990162b
BLAKE2b-256 dc78fdd1c42b53639f1f32ea7aab85e4f3a86d86b0a4d5045d8dca7a4817ae8a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for char_converter-0.36-py3-none-any.whl
Algorithm Hash digest
SHA256 078c0abef05efba87514979e87870ac97a6124052e5aaa068b612a980ebba74d
MD5 f0a1160d1490d2cda4f546145c6b3161
BLAKE2b-256 40e10771b27120977f31de76ec2a97dfa79fea6be917ce336d4c975fba0058ec

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