Git Product home page Git Product logo

char's Introduction

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

char's People

Contributors

yukiyuqichen avatar sudoghut avatar

Stargazers

 avatar  avatar Li Ying Claire avatar RoShio.Leo avatar Jiajun Zou avatar Damian M avatar  avatar Nick Budak avatar  avatar Duncan Paterson avatar Xiaokang Fu avatar  avatar  avatar

Watchers

 avatar  avatar

char's Issues

希望能提供 npm 包

感謝開發者帶來了這個實用的工具!

除了 Python 包之外,希望還能夠提供 npm 包,以便在 JavaScript 環境下也能夠使用。

也期待能夠支援以下的情況:

  • 能在瀏覽器環境中使用
  • 能離線使用 (不須額外連網下載數據)
  • 支持 TypeScript

謝謝!

new skip pairs for v2t

余 餘
范 範
鍾 鐘
斗 鬥
啓 啟
摹 摸
沖 衝
里 裏
群 羣
炤 照
峰 峯
遁 遯
栗 慄

Applying the update to the python package

I received a report that someone encountered a conversion error that we had fixed months ago.

What would be the best solution for our Python users to update the char package? Running

pip install char-converter -U

regularly?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.