Robin Chen

Results 8 comments of Robin Chen

@WojciechMula Hi, any chance of fixing this bug? This is quite severe because now the algorithm output is simply **incorrect**. I can give another example to reliably trigger this behavior...

@pombredanne I've put up a simpler example to reproduce this issue. ```python automaton = ahocorasick.Automaton() automaton.add_word("b", "b") automaton.add_word("abc", "abc") automaton.make_automaton() text = "abb" for i, s in automaton.iter_long(text): print(i, s)...

https://github.com/WojciechMula/pyahocorasick/blob/0bd7daa76b7ef7c7146eda86aa3e23b7341c0871/src/AutomatonSearchIterLong.c#L118-L125 I think it's at this if block, when the next node is not `eow`, it's simply skipped. Instead it should output the result pointed by the "dictionary suffix" of...

Well, put up another fix with more tests. #174 @pombredanne do you mind to take a look? Thanks.

This is indeed a bug introduced by a previous fix for `iter_long` missing legitimate short matches. I attempt a fix #186 and add more test cases, but cross my fingers...

ehhh, it does not fully work, since it's not enough to just look ahead one step. You need to look ahead all possible longer matches before deciding whether to fail...

#187 Come up with another fix, hopefully it works this time. Feedback welcomed. Note that in case of two partially overlapping strings it can't return the longest match, but the...