Current collected state Current
Observed since 21 Oct, 09:39 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
this project is a aho-corasick automaton implementation by python
ac自动机python的实现,可用于python2 python3等主流python发行版,对标准的ac自动机算法进行了完善 优化(主要是改进了结果的准确性)。
注意:为了保证结果的准确性,请安装使用最新版(0.0.9)。
pip install ahocorasick-python
git clone https://github.com/xizhicode/ahocorasick-python.git
cd ahocorasick-python && python setup.py install
注: 此处python3为例,python2也是类似的结果
import ahocorasick # 导入包
tree = ahocorasick.AhoCorasick("test","book","oo","ok", "k") # 构建ac自动机
print(tree.search("test book")) # 检索
输出结果:
{'test', 'k', 'oo', 'book', 'ok'}
import ahocorasick # 导入包
tree = ahocorasick.AhoCorasick("test","book","oo","ok", "k") # 构建ac自动机
print(tree.search("test book",True)) # 检索
输出结果:
{('k', (8, 9)), ('book', (5, 9)), ('oo', (6, 8)), ('ok', (7, 9)), ('test', (0, 4))}
QQ: 943489924
邮箱:zhoukunpeng504@163.com
如果在windows平台上遇到了编码问题,删除所有的中文即可。
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.0.9 | 23 Mar 2021 | 0 |
This describes our collected data; it is not a security assessment.
Shared repository data · GitHub
Observed since 21 Oct, 09:39 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:24121f127964e297df4495edc427ab5137ee4daf22499cdc8610ff4abf8730b9