JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6
  • Score
    100M100P100Q34455F
  • License CC0-1.0

Input a Chinese character. Output all the variant characters of it.

Package Exports

  • yitizi

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (yitizi) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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.