Re:Faster string searching and matching with Rabin-Karp algo...
by ahelwer on Saturday April 07, 2012 @12:17AM
(#3809954)
Those are for matching a single pattern against a text. The intended usage of Rabin-Karp is to match a set of patterns against a text, in a more efficient manner than running Boyer-Moore or KMP on each individual pattern. An algorithm with a similar use-case to Rabin-Karp is the Aho-Corasick algorithm, which is very simple to learn if you know KMP already - the preprocess of the set of patterns is just a generalization of the preprocess of the pattern in KMP.
http://en.wikipedia.org/wiki/Boyer%E2%80%93Moore_string_sear...
http://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pr...