Stuart Johnston wrote: > Bowie Bailey wrote: > > [EMAIL PROTECTED] wrote: > > > While I doubt it'd have quite the performance gains that A-C can > > > offer, Regexp::Assemble certainly sounds like something worth > > > trying... the coderef trick, in particular, is very nifty. > > > > It can work well. After reading about it here, I tried it on one of > > my programs that compares about 1600 words and phrases against a > > document. My scan time dropped by 30%. This doesn't count the time > > taken to assemble the regex (about .27 seconds), but since this > > program runs as a daemon and only has to do the assembly once, it > > wasn't relevant to me. > > Wouldn't assembling all rules into one regex make it impossible to > have per rule scores?
Not necessarily. In my case, I wasn't dealing with SA and since I was just matching simple words and phrases, it was easy enough to capture what was matched. If you read the docs for Regexp::Assemble, there is a way to run a custom routine for each match. This could be used to output the rule name that matched. It is probably not as efficient in this mode, but it still may be worth looking into. I was just pointing out that the module itself works well. -- Bowie