A library to convert variant Chinese characters to standard simplified or traditional characters.
Project description
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
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
- Mode: one2one
from char_converter import CharConverter
text = '苟馀情其訫姱㠯练要兮,镸顑頷亦何伤。'
converter = CharConverter('v2t')
converted_text = converter.convert(text)
# 苟餘情其信姱以練要兮,長顑頷亦何傷。
converter = CharConverter('v2s')
converted_text = converter.convert(text)
# 苟余情其信姱以练要兮,长顑颔亦何伤。
- 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
Dictionary of Variant Chinese Characters
General Standard Chinese Characters Table
Data filtering
Contributors
Yuqi Chen (data collection and programming)
Hongsu Wang (project manager)
Yiyi Wang (proofreading)
Fengyi Ji (data collection)
Kaini Xiong (proofreading)
License
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
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | d33ae33cdcf5054e1996b73e2e33333f8015850d01ad1737528351b4fe755511 |
|
MD5 | a426c23922f11ac37a764fd2c3b29e70 |
|
BLAKE2b-256 | 646ecd83f5e8407db0ef9253a4d82b3b71339b23a17af960126aed03542ca26e |
File details
Details for the file char_converter-0.40-py3-none-any.whl
.
File metadata
- Download URL: char_converter-0.40-py3-none-any.whl
- Upload date:
- Size: 158.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c61d40dbc6605297f9be125103f1fb82e9a139dd4d6736ac54556a9c828906a5 |
|
MD5 | a82fb2b74591628e154e4ac4ec2806eb |
|
BLAKE2b-256 | 17244e6c99386f48b9d2455d5c936efe1c002a1d1070a88510f78667f7c5efa2 |