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
Release history Release notifications | RSS feed
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)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e98bc21b672de2d96750ce1db8f7135c0c25ee9a6e203f03022fb5742dfbfea7
|
|
| MD5 |
1d3408bdf0926b53d3f475c5d9df9a3d
|
|
| BLAKE2b-256 |
50a36dffd36b26a67c9400b7e9a34a64ad3ce945877925c4d9a91e6c51dedf9e
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ea29eeab39812fe279b5d30c34ae623413e83508433903080be6ced75449207
|
|
| MD5 |
25511c02da1f69f9cfeda18b04ccde8f
|
|
| BLAKE2b-256 |
2bfbb26b6bce6a581f16aa78082500f2835d03541de9cfb139df6a5f129edb07
|