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:
It should found one match:
0 5 👨👨👦