Download presentation
Presentation is loading. Please wait.
1
Construction of Aho Corasick Automaton in Linear Time for Integer Alphabets Shiri Dori Gad M. Landau
2
ehit ey he irth is eyeher iri the iris thei their Aho-Corasick Automaton: Goto Function (trie) Failure Function Nodes with output her P = {her, their, eye, iris, he, is} 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
3
Goto function Failure function Output function
4
Goto Step 1: Sort the words, Using Suffix Arrays S P = $her$their$eye$iris$he$is$ eye, he, her, iris, is, their
5
Step 2 – Build the Trie Than, The, There, This T H A N E R E I S
6
Goto in O(N) time
7
Failure function S P =$HE$END$THE$ E N D H E T H E S P R =$EHT$DNE $EH$ Suffix Tree (S P R ) E$ EH $ EH T$ H$H$ HT$ DNE $ NE$ In O(n) time T$
8
e (e) r (r) t (t) ye (ey) eh (he) reh (her) eht (the) eye (eye) h (h) ht (th) i (i) iri (iri) ri (ir) rieht (their) si (is) siri (iris) $ $ $ $$$ $ $$ $ $ $ $$$ $ T R, the reverse suffix tree: Suffix Tree Links Endmarker Node with no Endmarker r $ P = {her, their, eye, iris, he, is} ieht (thei) $ z a b c d e f g hi j l n ok m p q
9
ehit ey he irth is eyeher iri the iris thei their Aho-Corasick Automaton: Goto Function (trie) Failure Function Nodes with output her P = {her, their, eye, iris, he, is} 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
10
(a) P = {her, their, eye, iris, he, is} i012345678910111213141516171819202122232425 SPRSPR $6$6 si$5$5 eh$4$4 siri$3$3 eye$2$2 rieht$1$1 reh$0$0 n-i252423222120191817161514131211109876543210 T R node abcdefghiJklmnopq Index in S P (with $) 10- 11 0-2 / 19- 21 4-7 10- 13 0-1 / 19- 20 4-6 14-15 / 22- 23 4-8 14- 17 No $0-3 14- 16 4-9 22- 24 14- 18 4-5 10- 12 Trie node 151434137159-68161110122 252423222120191817161514131211109876543210i $6$6 si$5$5 eh$4$4 siri$3$3 eye$2$2 rieht$1$1 reh$0$0 SPSP 11754109873211615141312654 Trie (b) (c)
11
Than, The, There, This T H A N E R E I S IEA
12
EN D
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.