Skip to main content

bd-wubi 数据集的 Python SDK,提供五笔查询与猜码能力。

Project description

bd-wubi Python SDK

bd-wubi Python SDK 内置五笔数据集,提供线程安全的正向(文本 → 编码)、反向(编码 → 文本)以及长词猜码功能,接口设计与 .NET 版本保持一致。

安装与使用

pip install bd-wubi
import bd_wubi

bd_wubi.initialize()  # 可省略;首次调用其他函数会自动初始化

entries = bd_wubi.get_by_text("信息")
codes = bd_wubi.get_by_code("nt")
guess = bd_wubi.guess_code("发展趋势")

initialize 可接受 WubiDictionaryOptions,用于配置缓存大小、是否缓存猜码结果、或指定自定义数据集路径。

运行单元测试

pip install -e .[test]
pytest

运行基准测试

python benchmarks/benchmark_wubi.py

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

bd_wubi-0.1.0.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

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

bd_wubi-0.1.0-py3-none-any.whl (1.5 MB view details)

Uploaded Python 3

File details

Details for the file bd_wubi-0.1.0.tar.gz.

File metadata

  • Download URL: bd_wubi-0.1.0.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for bd_wubi-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e98bc21b672de2d96750ce1db8f7135c0c25ee9a6e203f03022fb5742dfbfea7
MD5 1d3408bdf0926b53d3f475c5d9df9a3d
BLAKE2b-256 50a36dffd36b26a67c9400b7e9a34a64ad3ce945877925c4d9a91e6c51dedf9e

See more details on using hashes here.

File details

Details for the file bd_wubi-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: bd_wubi-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for bd_wubi-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8ea29eeab39812fe279b5d30c34ae623413e83508433903080be6ced75449207
MD5 25511c02da1f69f9cfeda18b04ccde8f
BLAKE2b-256 2bfbb26b6bce6a581f16aa78082500f2835d03541de9cfb139df6a5f129edb07

See more details on using hashes here.

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