You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Charles Gregory <cg...@hwcn.org> on 2004/03/09 00:08:52 UTC

Re: [spa] Suggested rule - beyond my ability to make

Once again, a suggestion for a rule based on the number of
matches/occurences. I still say this should be a generic mechanism
in SA, allowing flexible scoring, including zero for low counts.

On Mon, 8 Mar 2004, Al Danks wrote:
> Does anyone have a rule along this line:
> 
> Many superlatives-est: best, greatest, quickest, biggest, largest, etc.
> 
> Many superlatives-er:super, bigger, larger, quicker, thinner, etc.
> 
> Many superlatives exceptional, quick, completely, totally, absolutely
> 
> I'm thinking of something along the lines of:
> 
> body MANY_SUPERLATIVES_EST \b[best|greatest|quickest]\b/i{5}
> 
> another for 6, 7, 8, 9, at least 10.
> 
> Since I'm totally new to rule writing I hope I'm in the ballpark enough to 
> communicate what I'm trying to do, but I don't expect what I have will work.
> 
> Al
> 


Re: [spa] Suggested rule - beyond my ability to make

Posted by John Hardin <jo...@aproposretail.com>.
On Mon, 2004-03-08 at 15:48, Al Danks wrote:
> John Hardin <johnh <at> aproposretail.com> writes:
> 
> > > Once again, a suggestion for a rule based on the number of
> > > matches/occurences. I still say this should be a generic mechanism
> > 
> > Added to bugzilla earlier today.
> 
> So you're saying I can't get there from here - quite yet?

Maybe never, if nobody decides to implement the feature.

--
John Hardin  KA7OHZ                           
Internal Systems Administrator/Guru               voice: (425) 672-1304
Apropos Retail Management Systems, Inc.             fax: (425) 672-0192
-----------------------------------------------------------------------
 If you smash a computer to bits with a mallet, that appears to count
 as encryption in the state of Nevada.
                                               - CRYPTO-GRAM 12/2001
-----------------------------------------------------------------------


RE: [spa] Suggested rule - beyond my ability to make

Posted by John Hardin <jo...@aproposretail.com>.
On Tue, 2004-03-09 at 04:15, Rick Cooper wrote:

Is that the Rick Cooper I know from college?

> Wouldn't this do what you want?

> body __RC_B_05 /(?:(?=totally|absolutely|best)\b(\w+)\b.*?){5}/i
> body __RC_B_06 /(?:(?=totally|absolutely|best)\b(\w+)\b.*?){6}/i
> body __RC_B_07 /(?:(?=totally|absolutely|best)\b(\w+)\b.*?){7}/i
> body __RC_B_08 /(?:(?=totally|absolutely|best)\b(\w+)\b.*?){8}/i
> 
> meta RC_B_05 (__RC_B_05 && !__RC_B_06 && !__RC_B_07 &&
> !__RC_B_08)
> meta RC_B_06 (__RC_B_06 && !__RC_B_07 && !__RC_B_08)
> meta RC_B_07 (__RC_B_07 && !__RC_B_08)
> meta RC_B_08 (__RC_B_08)
> 
> describe RC_B_05 BODY: Five Superlatives
> describe RC_B_06 BODY: Six Superlatives
> describe RC_B_07 BODY: Seven Superlatives
> describe RC_B_08 BODY: Eight Superlatives
> 
> score RC_B_05 1.0
> score RC_B_06 1.5
> score RC_B_07 1.75
> score RC_B_08 2.0

Maybe, but I think this is a lot less opaque and easier for non-RE types
to understand and use:

  body SUPERLATIVE /(totally|absolutely|best)/
  describe SUPERLATIVE superlatives
  score SUPERLATIVE .25
  additive SUPERLATIVE

Granted, straight addition isn't terribly flexible. I really like
procmail's weighted scoring technique (see "man procmailsc"), where
subsequent matches can increase the score faster or slower. Maybe:

  additive NAME [weight]

like:

  score SUPERLATIVE .1
  additive SUPERLATIVE 2

Which would give a sequence of scores something like:

  matches    score
  1            .1
  2            .3
  3            .7
  4           1.5
  5           3.1

(The formula is more complex than the above example, but you get the
idea.)

--
John Hardin  KA7OHZ                           
Internal Systems Administrator/Guru               voice: (425) 672-1304
Apropos Retail Management Systems, Inc.             fax: (425) 672-0192
-----------------------------------------------------------------------
 If you smash a computer to bits with a mallet, that appears to count
 as encryption in the state of Nevada.
                                               - CRYPTO-GRAM 12/2001
-----------------------------------------------------------------------


RE: [spa] Suggested rule - beyond my ability to make

Posted by Rick Cooper <rc...@dwford.com>.

> -----Original Message-----
> From: news [mailto:news@sea.gmane.org]On Behalf Of Al Danks
> Sent: Monday, March 08, 2004 6:49 PM
> To: spamassassin-users@incubator.apache.org
> Subject: Re: [spa] Suggested rule - beyond my ability to make
>
>
> John Hardin <johnh <at> aproposretail.com> writes:
>
> > > Once again, a suggestion for a rule based on the number of
> > > matches/occurences. I still say this should be a
> generic mechanism
> >
> > Added to bugzilla earlier today.
>
> So you're saying I can't get there from here - quite yet?
>
> Al
>
Wouldn't this do what you want? (of course I didn't use as many
superlatives so it would fit the message width better without
wrapping)

body __RC_B_05 /(?:(?=totally|absolutely|best)\b(\w+)\b.*?){5}/i
body __RC_B_06 /(?:(?=totally|absolutely|best)\b(\w+)\b.*?){6}/i
body __RC_B_07 /(?:(?=totally|absolutely|best)\b(\w+)\b.*?){7}/i
body __RC_B_08 /(?:(?=totally|absolutely|best)\b(\w+)\b.*?){8}/i

meta RC_B_05 (__RC_B_05 && !__RC_B_06 && !__RC_B_07 &&
!__RC_B_08)
meta RC_B_06 (__RC_B_06 && !__RC_B_07 && !__RC_B_08)
meta RC_B_07 (__RC_B_07 && !__RC_B_08)
meta RC_B_08 (__RC_B_08)

describe RC_B_05 BODY: Five Superlatives
describe RC_B_06 BODY: Six Superlatives
describe RC_B_07 BODY: Seven Superlatives
describe RC_B_08 BODY: Eight Superlatives

score RC_B_05 1.0
score RC_B_06 1.5
score RC_B_07 1.75
score RC_B_08 2.0

I missed the original post, so maybe I am missing something, of
course the scores are purely arbitrary, and you would need to
carry the pattern to 10. Doing it this way would allow you to
score on 8 without also scoring on 5, 6 and 7, etc.


Re: [spa] Suggested rule - beyond my ability to make

Posted by Al Danks <ad...@calvin.edu>.
John Hardin <johnh <at> aproposretail.com> writes:

> > Once again, a suggestion for a rule based on the number of
> > matches/occurences. I still say this should be a generic mechanism
> 
> Added to bugzilla earlier today.

So you're saying I can't get there from here - quite yet?

Al


Re: [spa] Suggested rule - beyond my ability to make

Posted by John Hardin <jo...@aproposretail.com>.
On Mon, 2004-03-08 at 15:08, Charles Gregory wrote:
> Once again, a suggestion for a rule based on the number of
> matches/occurences. I still say this should be a generic mechanism

Added to bugzilla earlier today.

--
John Hardin  KA7OHZ                           
Internal Systems Administrator/Guru               voice: (425) 672-1304
Apropos Retail Management Systems, Inc.             fax: (425) 672-0192
-----------------------------------------------------------------------
 If you smash a computer to bits with a mallet, that appears to count
 as encryption in the state of Nevada.
                                               - CRYPTO-GRAM 12/2001
-----------------------------------------------------------------------