aho_corasick
aho_corasick copied to clipboard
A C++ implementation of the aho corasick pattern search algorithm
transition_collection get_transitions() const { transition_collection result; for (auto it = d_success.cbegin(); it != d_success.cend(); ++it) { result.push_back(it->first); //maybe it is a crash } return transition_collection(result); } code:result.push_back(it->first); i found it...
Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7fffdadb1700 (LWP 14062)] 0x0000000000834cc4 in aho_corasick::state::next_state(char, bool) const () at /home/opt/compiler/gcc-8.2/gcc-8.2/include/c++/8.2.0/bits/stl_tree.h:2549 2549 _Rb_tree:: #0 0x0000000000834cc4 in aho_corasick::state::next_state(char, bool) const () at...
https://github.com/cjgdev/aho_corasick/blob/b4fb360ef2764bf0cd22daaa62dd4bfd18b8ad0c/src/aho_corasick/aho_corasick.hpp#L463 I've found you got an error when adding items using iterators it should be: ``` for (InputIterator it = first; it != last; ++it) { ```
Hello, I got a performance problem about the ac machine of this project, and the following was my job. First i constructed a trie tree with 2700+ patterns and did...
[code ] ``` aho_corasick::trie trie; trie.remove_overlaps() .only_whole_words() .case_insensitive(); trie.insert("great question"); trie.insert("forty-two"); trie.insert("deep thought"); auto tokens = trie.tokenise("123great question"); std::stringstream html; html
In particular, the main `parse_text` method. Is it safe for multiple threads to call `parse_text` at the same time?
A data race was created when multiple threads entered `parse_text` at the same time and failure state construction was triggered. The first thread would enter the failure state construction function...
there are some cases that overlap matching has not been removed even .remove_overlaps() has been invoked.
- Fix benchmark bug that `bench_naive` falls into an infinite loop when pattern has matched. - Print out pattern matching count. - Reduce pattern length to increase matching probability.
The source code compiles fine under C++ 2011, But the benchmark can only use C++ 2017. For someone who only has C++ 2011, this `cmake` fails overall due to this...