跳转到主要内容

CJK(中文、日文、韩文)语言数据库。

项目描述

cihai · Python Package License Code Coverage

Python库,用于处理CJK(中文、日文、韩文)数据。

本项目正在积极开发中。关注我们的进展,并请定期查看更新!

快速入门

API / 库(此存储库)

$ pip install --user cihai
from cihai.core import Cihai

c = Cihai()

if not c.unihan.is_bootstrapped:  # download and install Unihan to db
    c.unihan.bootstrap()

query = c.unihan.lookup_char('好')
glyph = query.first()
print("lookup for 好: %s" % glyph.kDefinition)
# lookup for 好: good, excellent, fine; well

query = c.unihan.reverse_char('good')
print('matches for "good": %s ' % ', '.join([glph.char for glph in query]))
# matches for "good": 㑘, 㑤, 㓛, 㘬, 㙉, 㚃, 㚒, 㚥, 㛦, 㜴, 㜺, 㝖, 㤛, 㦝, ...

请参阅API文档和/examples

CLI(cihai-cli

$ pip install --user cihai-cli

字符查找

$ cihai info 
char: 
kCantonese: hou2 hou3
kDefinition: good, excellent, fine; well
kHangul: 
kJapaneseOn: KOU
kKorean: HO
kMandarin: hǎo
kTang: "*xɑ̀u *xɑ̌u"
kTotalStrokes: "6"
kVietnamese: háo
ucn: U+597D

反向查找

$ cihai reverse library
char: 
kCangjie: WLGA
kCantonese: syu1
kCihaiT: '308.302'
kDefinition: library
kMandarin: 
kTotalStrokes: '13'
ucn: U+5715
--------

UNIHAN数据

cihai使用的所有数据集都有独立的工具来导出数据。无需库。

开发中

$ git clone https://github.com/cihai/cihai.git`
$ cd cihai/

设置您的开发环境并了解如何贡献。我们跨越所有cihai项目使用相同的约定/工具:pytestsphinxmypyrufftmuxp以及文件监视器助手(例如entr(1))。

Python版本

  • 0.19.0:最后一个Python 3.7版本

快速链接

Docs Build Status

项目详情


发布历史 发布通知 | RSS订阅

下载文件

下载您平台对应的文件。如果您不确定选择哪个,请了解更多关于 安装包的信息

源代码分发

cihai-0.33.0.tar.gz (57.1 kB 查看哈希值)

上传时间 源代码

构建分发

cihai-0.33.0-py3-none-any.whl (25.2 kB 查看哈希值)

上传时间 Python 3

支持者