RepositoryPythonUSUnited States
howl-anderson

howl-anderson/hanzi_chaizi

汉字拆字库,可以将汉字拆解成偏旁部首,在机器学习中作为汉字的字形特征 | Hanzi Decomposition Library allows Chinese characters to be broken down into radicals and components, which can be used as character shape features in machine learning.

437stars
65forks
0issues
1views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: strokes

#1 Repository of the month

1
TINIX TRENDING·Topic: hanzi

#1 Repository of the month

1
TINIX TRENDING·Topic: chinese

#1 Repository of the month

Hanzi Chaizi | 汉字拆字

PyPI version Python CI License

Chinese character decomposition library for NLP and deep learning applications.

Decompose Chinese characters into basic structural components. Characters with similar structures yield similar decomposition results, making this useful as a glyph feature for deep learning models.

汉字拆字:将汉字拆解为基础部件。字形相似的字会得到相似的拆解结果,可用于深度学习模型的字形特征提取。

Features | 特性

  • Covers 20,000+ Chinese characters | 覆盖 20,000+ 汉字
  • Zero third-party dependencies | 零第三方依赖
  • Python 3.10+ support | 支持 Python 3.10+

Installation | 安装

pip install hanzi_chaizi

Usage | 使用

from hanzi_chaizi import HanziChaizi

hc = HanziChaizi()
result = hc.query('名')

print(result)

Output | 输出:

['夕', '口']

Notes | 说明

Some characters (e.g. 农, 表, 衣, 囊) contain \uf7ee in their decomposition results. This is a Unicode Private Use Area character representing the bottom part of 衣 (the downward strokes), which has no standard Unicode codepoint.

部分汉字(如 农、表、衣、囊)的拆解结果中包含 \uf7ee。这是一个 Unicode 私有区域字符,用于表示"衣"的下半部分(撇捺结构),该部件在标准 Unicode 中没有独立编码。

Some characters cannot be decomposed. See non_decomposable.txt for the list.

部分汉字无法被拆解,详见 non_decomposable.txt。

Development | 开发

See develop.md for development guide. | 参见 develop.md 开发指南。

Credits | 致谢

Data from 漢語拆字字典 (CC BY 3.0) | 数据来自 漢語拆字字典 (CC BY 3.0)

Citation | 引用

@misc{kong2018hanzichaizi,
  title={Hanzi Chaizi},
  author={Xiaoquan Kong},
  howpublished={https://github.com/howl-anderson/hanzi_chaizi},
  year={2018}
}

If the package is cited in books, seminars, and academic research papers, or used in company products, you are welcome (but not required) to email me about this. I'm glad to see the package being used and valuable to everyone.

如果本项目被书籍、学术论文引用,或被公司产品使用,欢迎(但不强求)告知我。很高兴看到这个项目对大家有价值。

Similar Projects

Discover other similar projects and AI models.

RepositoryPython
pwxcoo/chinese-xinhua

:orange_book: 中华新华字典数据库。包括歇后语,成语,词语,汉字。

11.8k
Dec 26, 2023
RepositoryHTML
parsimonhi/animCJK

Draw animated Japanese characters (Kanji and Kana), Korean characters (Hanja) and Chinese characters (Hanzi) in correct stroke order using svg, free open-source code.

482
Nov 25, 2026
RepositoryRuby
drkameleon/complete-hsk-vocabulary

Complete, HSK 2.0/3.0 (汉语水平考试) Vocabulary Lists in Json

338
Mar 27, 2026
Repository
parlr/hanzi-pinyin-font

Chinese font displaying Hanzi (汉字) characters with by transliteration/pronunciation (Pīnyīn).

185
Feb 13, 2025
Repository
zispace/hanzi-chars

常用中文汉字表和字符集:汉字 / 漢字 / かんじ Kanji / 한자 hanja / 𡨸漢 hán tự

159
Sep 28, 2026
RepositoryTypeScript
Mr-funny/hbg-hanzi-chaizi-video

用 Remotion + Edge TTS 制作上方逐笔写字、下方趣味拆字变形的 9:16 汉字短视频

124
Aug 8, 2026
RepositoryPython
d2l-ai/d2l-zh

《动手学深度学习》:面向中文读者、能运行、可讨论。中英文版被70多个国家的500多所大学用于教学。

82.9k
Jul 30, 2024
RepositoryPython
2noise/ChatTTS

A generative speech model for daily dialogue.

40.1k
Apr 10, 2026
RepositoryPython
PDFMathTranslate/PDFMathTranslate

[EMNLP 2025 Demo] PDF scientific paper translation with preserved formats - 基于 AI 完整保留排版的 PDF 文档全文双语翻译,支持 Google/DeepL/Ollama/OpenAI 等服务,提供 CLI/GUI/MCP/Docker/Zotero

38.8k
Dec 1, 2026