procmail
[Top] [All Lists]

Re: Score and _AND_

2002-10-10 13:08:43
On Thu, 10 Oct 2002, David W. Tamkin wrote:

In fact, I was going to suggest scoring 1 for word1, 1000 for word2, and
1000000 for word3; the trouble was that Udi wanted to know the total
number of occurrences of any of the words, and it would be a pain to
break down the score (what if word3 might not appear at all, so you
couldn't predict the number of digits in the final score?) in order to
add the three individual counts.

To make the number of digits fixed, just add a throwaway digit:

:0
*        1^1 word1
*     1000^1 word2
*  1000000^1 word3
* 10000000^0
{ SCORE=$= }

Of course you can't use this trick for more than 3 words, if you want to
allow 3 digits per word.

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>