I am not sure that i...@e., nor boyer-moore is the
right approach here.

The problem with boyer-moore (and E.) is that it
requires that there be an "end".  But the problem
here has us searching for a variable length list
of strings.

That said, if you group them into parallel searches
where each parallel search was for strings of the same
length, then E. should work, and boyer-moore should
work.

Anyways, if I were trying to implement this in J, I
imagine I would want to use ;: or something like it

In other words, I am thinking of building a state
engine based on the list of phrases I would be
searching for.  I would then have to track the state
at each character position in the string to be searched
and "matching states" would correspond to the
end of a match (and I would have to look up the
length of that matching state to find the offset back
to the beginning).

However, the code to build that state machine would
be hard for me to write (especially since I would
need to deal with partial overlaps).

-- 
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to