bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using the Aho-Corasick implementation of fgrep for the Baker and Bird al


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)

Hi, i am trying to program the Baker and Bird two dimensional pattern matching algorithm but i experience some difficulties.

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]