Skip to main content

Chinese IME ciku (aka word list / lexicon file) parsing tool

Project description

Ciku (IME-Utils)

GitHub stars GitHub release GitHub repo size GitHub license

中文输入法词库文件(细胞词库)解析工具。

Chinese IME ciku (aka word list / lexicon file) parsing tool.

支持:

  • 搜狗拼音(.scel
  • 百度拼音(.bdict)、百度输入法手机版(.bcd
  • QQ 拼音(.qcel)、QQ 拼音旧版(6.0 以下词库,.qpyd
  • 华宇拼音(紫光输入法)(.uwl

使用

  • 程序调用:
# 安装
# pip install ciku # ime-utils
# uv pip install -e . # 本地安装(Editable packages)

# 用例:
from ciku import SogouParser, BaiduParser

parser = BaiduParser()
files = [
    "医学词汇.bdict",
    "电影明星.bdict",
    "体操基本术语.bdict",
]

for file in files:
    save_file = f"out-{file}.txt"
    if parser.parse(file):
        parser.save_data(save_file, keep_error=False)
        result = parser.export_data()
  • 命令行调用
# 或者 python -m ciku -f file-names -o output

# 指定多个文件
ciku -f file-name1,file-name2 -o output
# 指定目录,-e保留解析异常词语, -r 目录递归检索文件
ciku -d file-dir -o text -e -r

开发

# 安装uv <https://docs.astral.sh/uv/>

# 开发环境
uv sync # --dev --all-extras # --locked

# 提交前检查语法等
uvx ruff check .
uvx mypy .

# 构建
uv build

相关

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

ciku-0.3.0.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ciku-0.3.0-py3-none-any.whl (25.3 kB view details)

Uploaded Python 3

File details

Details for the file ciku-0.3.0.tar.gz.

File metadata

  • Download URL: ciku-0.3.0.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ciku-0.3.0.tar.gz
Algorithm Hash digest
SHA256 737a53d13ecd4946bb834c980c47f031ca61545c29850a3f6e0658ea3cdd11af
MD5 3fefab737d1a6d5162ff0833df20969d
BLAKE2b-256 f3cc596cd268b66e814eec5353845f0b290febe1d87ffae17d3df02e845e93f0

See more details on using hashes here.

Provenance

The following attestation bundles were made for ciku-0.3.0.tar.gz:

Publisher: python-publish.yml on hantang/python-ciku

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ciku-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: ciku-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 25.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ciku-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5f2139617f4f0a711d1c275d2b1861a8173e70d34f7fd89ccb4509f2ace278ab
MD5 1ed81a7104fdee9405d54af316f6f7d9
BLAKE2b-256 29b2c0d9e604527d56f0d89b3bf396e79c52ceab522c640921de39540a7b2c09

See more details on using hashes here.

Provenance

The following attestation bundles were made for ciku-0.3.0-py3-none-any.whl:

Publisher: python-publish.yml on hantang/python-ciku

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page