[cvs] bogofilter bogofilter.c,1.42,1.43 bogofilter.h,1.16,1.17
Fast Bayesian spam filter along lines suggested by Paul Graham
Brought to you by:
m-a
From: <re...@us...> - 2002-10-19 21:57:31
|
Update of /cvsroot/bogofilter/bogofilter In directory usw-pr-cvs1:/tmp/cvs-serv1037 Modified Files: bogofilter.c bogofilter.h Log Message: Defined macros MIN_DEV, SPAM_CUTOFF, and GOOD_BIAS so that their values are controlled by the original/robinson switches. Index: bogofilter.c =================================================================== RCS file: /cvsroot/bogofilter/bogofilter/bogofilter.c,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** bogofilter.c 19 Oct 2002 18:22:52 -0000 1.42 --- bogofilter.c 19 Oct 2002 21:57:26 -0000 1.43 *************** *** 49,53 **** #define DEVIATION(n) fabs((n) - EVEN_ODDS) // deviation from average ! #define MIN_DEV 0.0f // if nonzero, use characteristic words #define ORIGINAL_SPAM_CUTOFF 0.90f // if it's spammier than this... --- 49,60 ---- #define DEVIATION(n) fabs((n) - EVEN_ODDS) // deviation from average ! #define ORIGINAL_MIN_DEV 0.4f // look for characteristic words ! #define ROBINSON_MIN_DEV 0.0f // if nonzero, use characteristic words ! #define MIN_DEV (original_algorithm ? ORIGINAL_MIN_DEV : ROBINSON_MIN_DEV) ! ! #define ORIGINAL_SPAM_CUTOFF 0.90f // if it's spammier than this... ! #define ROBINSON_SPAM_CUTOFF 0.52f // if it's spammier than this... ! #define SPAM_CUTOFF (original_algorithm ? ORIGINAL_SPAM_CUTOFF : ROBINSON_SPAM_CUTOFF) ! #define ORIGINAL_SPAM_CUTOFF 0.90f // if it's spammier than this... *************** *** 63,68 **** #define PLURAL(count) ((count == 1) ? "" : "s") - - extern bool original_algorithm, robinson_algorithm; extern char msg_register[]; --- 70,73 ---- Index: bogofilter.h =================================================================== RCS file: /cvsroot/bogofilter/bogofilter/bogofilter.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** bogofilter.h 14 Oct 2002 21:12:43 -0000 1.16 --- bogofilter.h 19 Oct 2002 21:57:26 -0000 1.17 *************** *** 8,12 **** #include <wordlists.h> ! #define GOOD_BIAS 2 // give good words more weight typedef enum rc_e {RC_SPAM=0, RC_NONSPAM=1} rc_t; --- 8,16 ---- #include <wordlists.h> ! extern bool original_algorithm, robinson_algorithm; ! ! #define ORIGINAL_GOOD_BIAS 2 // don't give good words more weight ! #define ROBINSON_GOOD_BIAS 1 // don't give good words more weight ! #define GOOD_BIAS (original_algorithm ? ORIGINAL_GOOD_BIAS : ROBINSON_GOOD_BIAS) typedef enum rc_e {RC_SPAM=0, RC_NONSPAM=1} rc_t; |