optimizing a "thesaurus" or patterns set ...

"Giovanni Azua" <[email protected]> Fri, 26 Nov 2004 19:44:28 +0100
Newsgroups gmane.comp.jakarta.regexp.user
Message-ID <[email protected]>
Hello all,

While using regex to achieve transformation using=20
a few patterns is not a big deal, performance problems
will for sure show up having a transformation that=20
includes many patterns e.g. >2000 patterns to match=20
against, doing it sequentially (where some patterns=20
will easily not match) is a performance killer.

My question is, does anyone know a way to=20
automatically prune or merge a set of patterns
into some structure suitable for fast search over
e.g. search tree? Something like given 2000 regular
expressions with associated replacement becomes=20
a "transformation tree" which will hopefully have
a very low height.

Thanks in advance,
Best Regards,
Giovanni

Giovanni Azua
Software Engineer
kdlabs AG
www.kdlabs.com
Flurstrasse 32
Z=FCrich CH-8048
Phone: +4114056619
Mobile: +41788899369