[Bogofilter-cvs] bogofilter bogofilter.c,1.2,1.3
Fast Bayesian spam filter along lines suggested by Paul Graham
Brought to you by:
m-a
From: <re...@us...> - 2002-09-15 16:37:30
|
Update of /cvsroot/bogofilter/bogofilter In directory usw-pr-cvs1:/tmp/cvs-serv780 Modified Files: bogofilter.c Log Message: Implement Eric Seppanen's fix so that bogofilter() properly populates the stats.extrema array. A new word goes into the first empty slot of the array. If there are no empty slots, it replaces the word with the spamicity index closest to 0.5. Index: bogofilter.c =================================================================== RCS file: /cvsroot/bogofilter/bogofilter/bogofilter.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** bogofilter.c 15 Sep 2002 16:16:50 -0000 1.2 --- bogofilter.c 15 Sep 2002 16:37:27 -0000 1.3 *************** *** 1,4 **** --- 1,9 ---- /* $Id$ */ /* $Log$ + /* Revision 1.3 2002/09/15 16:37:27 relson + /* Implement Eric Seppanen's fix so that bogofilter() properly populates the stats.extrema array. + /* A new word goes into the first empty slot of the array. If there are no empty slots, it replaces + /* the word with the spamicity index closest to 0.5. + /* /* Revision 1.2 2002/09/15 16:16:50 relson /* Clean up underflow checking for word counts by using max() instead of if...then... *************** *** 469,473 **** dev = DEVIATION(prob); hit = NULL; ! hitdev=0; for (pp = stats.extrema; pp < stats.extrema+sizeof(stats.extrema)/sizeof(*stats.extrema); pp++) { --- 474,478 ---- dev = DEVIATION(prob); hit = NULL; ! hitdev=1; for (pp = stats.extrema; pp < stats.extrema+sizeof(stats.extrema)/sizeof(*stats.extrema); pp++) { *************** *** 481,485 **** { slotdev=DEVIATION(pp->prob); ! if (dev>slotdev && dev>hitdev) { hit=pp; --- 486,490 ---- { slotdev=DEVIATION(pp->prob); ! if (dev>slotdev && hitdev>slotdev) { hit=pp; |