中日韩语言资料库。
cihai的Python项目详细描述
cihai-用于CJK(中文、日文、韩文)数据的python库
这个项目正在积极开发中。跟踪我们的进度并检查 回来更新!
用法
API/库(此存储库)
$ pip install --user cihai
fromcihai.coreimportCihaic=Cihai()ifnotc.unihan.is_bootstrapped:# download and install Unihan to dbc.unihan.bootstrap(unihan_options)query=c.unihan.lookup_char('好')glyph=query.first()print("lookup for 好: %s"%glyph.kDefinition)# lookup for 好: good, excellent, fine; wellquery=c.unihan.reverse_char('good')print('matches for "good": %s '%', '.join([glph.charforglphinquery]))# matches for "good": 㑘, 㑤, 㓛, 㘬, 㙉, 㚃, 㚒, 㚥, 㛦, 㜴, 㜺, 㝖, 㤛, 㦝, ...
cli(cihai-cli)
# pre-release $ pip install --user cihai[cli]
# character lookup $ 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 # reverse lookup $ cihai reverse library char: 圕 kCangjie: WLGA kCantonese: syu1 kCihaiT: '308.302' kDefinition: library kMandarin: tú kTotalStrokes: '13' ucn: U+5715 --------
快速链接
Python support | Python 2.7, >= 3.5, pypy |
Source | https://github.com/cihai/cihai |
Docs | https://cihai.git-pull.com |
Changelog | https://cihai.git-pull.com/en/latest/history.html |
API | https://cihai.git-pull.com/en/latest/api.html |
Issues | https://github.com/cihai/cihai/issues |
Travis | https://travis-ci.org/cihai/cihai |
Test coverage | https://codecov.io/gh/cihai/cihai |
pypi | https://pypi.python.org/pypi/cihai |
OpenHub | https://www.openhub.net/p/cihai |
License | MIT |
git repo | ^{pr 5}$ |
install stable | ^{pr 6}$ |
install dev | ^{pr 7}$ |
tests | ^{pr 8}$ |