|
From: | Charis Kouzinopoulos |
Subject: | Using the Aho-Corasick implementation of fgrep for the Baker and Bird algorithm |
Date: | Thu, 29 Jan 2009 14:43:52 +0200 |
User-agent: | Thunderbird 2.0.0.19 (X11/20090105) |
First of all this is how the algorithm works: Baker and Bird searches a n * n two dimensional array for all the occurrences of a two dimensional m * m array (where m<n) using an automaton. If a match is found on one row, then the m-1 rows bellow the current are examined to find out if the rest of the array's lines match.
The algorithm is working but the problem is that it needs to call the COMPILE_FCT(Fcompile) function, in order to construct the DFA, m times for each of the partial matches of the n lines, a suboptimal solution. Is there a way to create m different DFA's in the beginning of the program and then just call them separately as needed without constructing them all over again?
This has been bugging me for so long, i would appreciate any help! Charis
[Prev in Thread] | Current Thread | [Next in Thread] |