120 likes | 259 Views
Construction of Aho Corasick Automaton in Linear Time for Integer Alphabets Shiri Dori Gad M. Landau. Aho-Corasick Automaton: Goto Function (trie) Failure Function Nodes with output. her. . 1. 4. 12. 7. e. h. i. t. 11. 2. 13. 8. 5. ey. he. ir. is. th. 9. 3. 6. 14.
E N D
Construction of Aho Corasick Automaton in Linear Time for Integer Alphabets Shiri Dori Gad M. Landau
Aho-Corasick Automaton: Goto Function (trie) Failure Function Nodes with output her 1 4 12 7 e h i t 11 2 13 8 5 ey he ir is th 9 3 6 14 eye her iri the 10 15 iris thei 16 their P = {her, their, eye, iris, he, is}
Goto function • Failure function • Output function
Goto Step 1: Sort the words, Using Suffix Arrays SP= $her$their$eye$iris$he$is$ eye, he, her, iris, is, their
Step 2 – Build the Trie Than, The, There, This T H A I E N R S E
Failure function SP=$HE$END$THE$ In O(n) time SPR=$EHT$DNE$EH$ Suffix Tree (SPR) DNE$ T$ E H T E$ NE$ N H$ H E D E EH$ HT$ EHT$
$ z p a e g j n q e (e) h (h) i (i) r (r) si (is) t (t) ye (ey) b h i k l o d f $ $ $ $ $ $ eh (he) eye (eye) ht (th) ieht (thei) iri (iri) reh (her) ri (ir) siri (iris) c m $ $ $ $ $ $ $ $ eht (the) rieht (their) $ $ TR, the reverse suffix tree: Suffix Tree Links Endmarker Node with no Endmarker $ P = {her, their, eye, iris, he, is} r
Aho-Corasick Automaton: Goto Function (trie) Failure Function Nodes with output her 1 4 12 7 e h i t 11 2 13 8 5 ey he ir is th 9 3 6 14 eye her iri the 10 15 iris thei 16 their P = {her, their, eye, iris, he, is}
(a) (b) (c) P = {her, their, eye, iris, he, is}
Than, The, There, This T H A I E N R S E