Source
20
20
* "on the fly" as needed. Roughly speaking, for any state
21
21
* "q" = 0,1,...,m and any character "a" in SIGMA, the value
22
22
* PI["q"] contains the information that is independent of "a" and
23
23
* is needed to compute DELTA("q", "a") [2]. Since the array PI
24
24
* has only m entries, whereas DELTA has O(m|SIGMA|) entries, we
25
25
* save a factor of |SIGMA| in the preprocessing time by computing
26
26
* PI rather than DELTA.
27
27
*
28
28
* [1] Cormen, Leiserson, Rivest, Stein
29
29
* Introdcution to Algorithms, 2nd Edition, MIT Press
30
-
* [2] See finite automation theory
30
+
* [2] See finite automaton theory
31
31
*/
32
32
33
33
#include <linux/module.h>
34
34
#include <linux/types.h>
35
35
#include <linux/string.h>
36
36
#include <linux/ctype.h>
37
37
#include <linux/textsearch.h>
38
38
39
39
struct ts_kmp
40
40
{