Skip to main content

成语检索工具

Project description

检索语句中是否有成语(Python 版)

用于检索语句中是否有成语。

关于

安装

$ pip install idiom-search

升级

$ pip install -U idiom-search

依赖库

pypinyin>=0.55.0

使用示例

首先导入库

import idiom_search as idiom

检索一句话中是否包含成语。

idiom.search_idiom('他一欣一意地完成工作,结果却画蛇添足了。')
>>> True

功能说明:

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.9.tar.gz (4.6 MB view details)

Uploaded Source

Built Distribution

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

idiom_search-1.0.9-py3-none-any.whl (4.8 MB view details)

Uploaded Python 3

File details

Details for the file idiom_search-1.0.9.tar.gz.

File metadata

  • Download URL: idiom_search-1.0.9.tar.gz
  • Upload date:
  • Size: 4.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for idiom_search-1.0.9.tar.gz
Algorithm Hash digest
SHA256 3f81f9a181975f219e3b02519ecf1a23008850b43b75037dd6ba4bb615ef0e2c
MD5 5fac11dfd6eff7ce3f957c5778add7fe
BLAKE2b-256 a3226037cbdf636231f9351c8197013ebbfce955043f82055f0c51e733e631d6

See more details on using hashes here.

File details

Details for the file idiom_search-1.0.9-py3-none-any.whl.

File metadata

  • Download URL: idiom_search-1.0.9-py3-none-any.whl
  • Upload date:
  • Size: 4.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for idiom_search-1.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 5ff2ab219e957656dd502fbf18665d5475c38f13c0359032f5af28e217ba71f6
MD5 b48840e0888d28c6a8d46ff6af69a542
BLAKE2b-256 2bd3492ca8c4f0fd4c21a39da7a7c65858b716aaf48003319150402dd670b56f

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