成语检索工具
Project description
检索语句中是否有成语(Python 版)
用于检索语句中是否有成语。
关于
- Gitee: https://gitee.com/cnhsqk/idiom_search
- PyPI: https://pypi.org/project/idiom_search/
- Python version: >= 3.6.0
- License: MIT license
安装
$ pip install idiom-search
升级
$ pip install -U idiom-search
依赖库
pypinyin>=0.55.0
使用示例
首先导入库
import idiom_search as idiom
1. 判断一个词是否是成语。
idiom.search_idiom('他一欣一意地完成工作,结果却画蛇添足了。')
>>> True
2. 搜索成语
功能说明:
search_idiom(sentence, fuzzy_threshold = 0.8)
:param sentence: str,一句话
:param fuzzy_threshold: int, 模糊匹配阈值,默认为:0.8。 值越高要求越精确。
:return: list 按匹配有限度排列。匹配度越高的在数组中排行越靠前
实用式例:
idiom.search_idiom(word='他一欣一意地完成工作,结果却画蛇添足了。')
>>> ['一心一意', '画蛇添足', '一心一力', '一心一计']
资源文件
Lincese
MIT License
Copyright (c) 2025 tangwei-dev
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
idiom_search-1.0.3.tar.gz
(4.2 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 idiom_search-1.0.3.tar.gz.
File metadata
- Download URL: idiom_search-1.0.3.tar.gz
- Upload date:
- Size: 4.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e90178fe78bb07d71cd89bde35e8bff5a3fb92dd2202f44b9605594d9348c39
|
|
| MD5 |
143cbc0d2d000bbf25a0e2cc6b7c60fb
|
|
| BLAKE2b-256 |
d88e1963c6948f7c67f6100b7371d6d37a791ee242a896c64d4d8515e9837050
|
File details
Details for the file idiom_search-1.0.3-py3-none-any.whl.
File metadata
- Download URL: idiom_search-1.0.3-py3-none-any.whl
- Upload date:
- Size: 4.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e232b1f86853f537ff815b5262a880cc2966e6b524baf8c6a5da97dc6976b8a
|
|
| MD5 |
29158900c2244df2ec353d3fde3e2233
|
|
| BLAKE2b-256 |
b7793aa65c8225e4d93c86dd4b1218ababc8871af889c38400de07496bfbabca
|