Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Aho-Corasick

One automaton for the whole dictionary, one pass over the text, demoing the p/moul/x/daily/ahocorasick library.

thermos

Patterns the, he, fox, over, lazy.

start end pattern
0 3 the
1 3 he

5 patterns, 17 automaton nodes, 7 bytes read once, 2 matches. Running a single-pattern scan per word would read those bytes 5 times instead.