On Wed, 2014-09-03 at 17:18 -0400, Kevin A. McGrail wrote:
> On 9/3/2014 5:14 PM, Karsten Bräckelmann wrote:
> > > > The specified criteria are trivial, and can be easily translated into
> > > > rules. [...]

> > header __PHIL_TO    To:addr =~ /phil\@example.com/i
> > header __PHIL_SUBJ  Subject =~ /\b(cv|curriculum)\b/i
> >
> > meta     PHIL_CURRICULUM      __PHIL_TO && __PHIL_SUBJ
> > describe PHIL_CURRICULUM      CV for Phil
> > score    PHIL_CURRICULUM      -2
> >
> > meta     PHIL_NOT_CURRICULUM  __PHIL_TO && !__PHIL_SUBJ
> > describe PHIL_NOT_CURRICULUM  Not a CV for Phil
> > score    PHIL_NOT_CURRICULUM  1

> It appears I did not email the list my response but should provide an 
> interesting exercise if only to see how similar our approach was:

Which isn't much of a surprise. It's practically the very translation of
the stated requirements into simple logic and regex header rules. ;)


> header __KAM_PHIL1    To =~ /phil\@example\.com/i
> header __KAM_PHIL2    Subject =~ /(?:CV|Curriculum)/i

Bonus points for using non-matching grouping. But major deduction of
points for that entirely un-anchored case insensitive 'cv' substring
match.

(As a matter of principle, since that's a seriously short substring
match. Granted, that char combination is pretty rare in dict/words.)


-- 
char *t="\10pse\0r\0dtu\0.@ghno\x4e\xc8\x79\xf4\xab\x51\x8a\x10\xf4\xf4\xc4";
main(){ char h,m=h=*t++,*x=t+2*h,c,i,l=*x,s=0; for (i=0;i<l;i++){ i%8? c<<=1:
(c=*++x); c&128 && (s+=h); if (!(h>>=1)||!t[s+h]){ putchar(t[s]);h=m;s=0; }}}

Reply via email to