WojciechMula / pyahocorasick

Python module (C extension and plain python) implementing Aho-Corasick algorithm
BSD 3-Clause "New" or "Revised" License
937 stars 122 forks source link

iter_long does not work properly #189

Open djstrong opened 10 months ago

djstrong commented 10 months ago
automaton = ahocorasick.Automaton()
    input='👨‍👨‍👦'
    for c in input:
        automaton.add_word(c, c)
    automaton.add_word(input, input)
    automaton.make_automaton()
    for end_index, value in automaton.iter_long(input):
        end_index += 1
        start_index = end_index - len(value)
        print('FOUND', start_index, end_index, value)

Response is:

FOUND 1 2 ‍
FOUND 3 4 ‍
FOUND 4 5 👦

It should found one match: 0 5 👨‍👨‍👦