Input a Chinese character. Output all the variant characters of it.
Project description
Yitizi
Input a Chinese character. Output all the variant characters of it.
輸入一個漢字,輸出它的全部異體字。
输入一个汉字,输出它的全部异体字。
Usage
Python
Installation:
pip install yitizi
Usage:
>>> import yitizi
>>> yitizi.get('和')
['咊', '龢']
JavaScript
Installation:
Usage:
> const Yitizi = require('./index.js')
> Yitizi.get('和')
[ '咊', '龢' ]
Design
As shown in the figure, the following information is stored in yitizi.csv
:
This file is processed by build/main.py
. The data in the file is converted into a graph.
Then, for each node in the graph, output the node and all its neighbor nodes. This becomes the final dictionary of the variant characters.
{ 正字: 異體字1, 異體字2,
異體字1: 正字,
異體字2: 正字
}
When using the library, the above dictionary is used to determine the variant characters of a given character.
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
yitizi-0.0.1.tar.gz
(5.7 kB
view hashes)
Built Distribution
yitizi-0.0.1-py3-none-any.whl
(41.3 kB
view hashes)