aho_corasick

时间:2021-06-12 01:47:44
【文件属性】:
文件名称:aho_corasick
文件大小:79KB
文件格式:ZIP
更新时间:2021-06-12 01:47:44
C++ Aho-Corasick 实现 (C++) 这是由 Alfred V. Aho 和 Margaret J. Corasick 发明的 aho-corasick 模式搜索算法的仅标头实现。 它是一种非常有效的字典匹配算法,可以在 O(n + m) 内同时定位输入文本中的所有搜索模式,空间复杂度为 O(m)(其中 n 是输入文本的长度,m 是组合搜索模式的长度)。 要编译代码,您的编译器必须至少支持 C++11 标准的以下功能: 基于范围的 for 循环。 std::unique_ptr。 汽车。 此外,该基准测试使用了 chrono。 用法 下面将创建一个窄字符串 trie(对于宽字符串支持,使用 aho_corasick::wtrie),将几个模式添加到 trie,然后在输入文本中搜索它们。 aho_corasick::trie trie; trie.insert( " he
【文件预览】:
aho_corasick-master
----.gitignore(181B)
----src()
--------benchmark()
--------CMakeLists.txt(1KB)
--------aho_corasick()
----README.md(4KB)
----cmake()
--------EnableStdCXX11.cmake(2KB)
----test()
--------catch.hpp(312KB)
--------emit_test.cpp(1KB)
--------interval_test.cpp(2KB)
--------interval_tree_test.cpp(3KB)
--------trie_test.cpp(6KB)
--------state_test.cpp(2KB)
--------CMakeLists.txt(1KB)
----CMakeLists.txt(2KB)

网友评论