procmail
[Top] [All Lists]

Re: Score and _AND_

2002-10-10 12:51:59
Udi quoted Dallman,

| > Okay, how about assigning to
| > each of the words different incremental spreads?  Is there
| > an anticipated maximum number of times the words will appear?
| > Say, under 10 times each?  If under ten, you could assign increments
| > of 1 to word1, 10 to word2, and 100 to word3.  A final score of
| > 564 means word1 appeared five times, word2 six times, and word3 four.
| > Or increment word1 by 1, word2 by 1000, and word3 by 100000.

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.

As to using 1, 10, and 100, I'd shy from that: you can't get so cocky that
none of the words will appear ten or more times.

Udi answered,

| Nice trick!  Remind my another scenario when you do not need to
| count the appearances:
|
| :0 B
| * 1^0 word1
| * 2^0 word2
| * 4^0 word3
| * 8^0 word4

Now *that* -- where we're not counting the appearances -- is the place to use
every power of ten.  Powers of two are not so good; once you get a total score
you'd need to call an outside program to convert it from decimal to binary so
that you could parse it or go through some nasty subtractions.



_______________________________________________
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>