> -----Original Message----- > From: Charles Gregory [mailto:[EMAIL PROTECTED] > Sent: Tuesday, January 13, 2004 10:16 AM > To: [EMAIL PROTECTED] > Subject: Re: [WL] [SAtalk] How to count pattern matches? > > > On Tue, 13 Jan 2004, Christian Recktenwald wrote: > > is there a possibility to count the number of occurences of a > > given pattern? > > I've asked for this before. Never heard any replies. > I was actually hoping for a test with a minimum threshold, > such as "If count is greater than 5" then score 'x'. >
your best bet currently is to write an eval and add it manually... at least until we can local.cf our own evals, which i believe is coming soon if i remember the discussion. o.k... now a little off topic :) what would really be nice, is to be able to return a score from an eval... instead of just true/false and then scoring based on a "score RULENAME" line. that would prevent having to call an eval a dozen times with different $min and $max values to determine what the score should be. i know most evals return if $self->{eval_variable} exists, so it doesnt hamper performance much if any when the same eval is called many times over.... i think the only big thing you loose doing something like that, is the ability to see what rules fired, and the descriptions associated with them. maybe adding an extension onto it eval:function(), say eval_score:function(), which makes a rule look like body TEST_EVAL_SCORE eval_score:function_name() describe TEST_EVAL_SCORE this is a test score _TEST_EVAL_SCORE_ i'm not sure exactly how the score line would work, as score needs to be substituted from the return value of function_name()... maybe storing the return value into a tag like _HITS_, _YESNO_, etc, but instead it is the _RULENAME_ ?? not sure if this is possible the way Conf.pm parses the .cf's before eval's are ever ran.... but its a thought nontheless. d ------------------------------------------------------- This SF.net email is sponsored by: Perforce Software. Perforce is the Fast Software Configuration Management System offering advanced branching capabilities and atomic changes on 50+ platforms. Free Eval! http://www.perforce.com/perforce/loadprog.html _______________________________________________ Spamassassin-talk mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/spamassassin-talk