[cvs] bogofilter fisher.c,1.19,1.20 config.c,1.94,1.95 globals.c,1.3,1.4 globals.h,1.27,1.28
Fast Bayesian spam filter along lines suggested by Paul Graham
Brought to you by:
m-a
From: <re...@us...> - 2003-01-22 20:22:25
|
Update of /cvsroot/bogofilter/bogofilter In directory sc8-pr-cvs1:/tmp/cvs-serv12792 Modified Files: fisher.c config.c globals.c globals.h Log Message: Define convenience '-2' and '-3' command line switches to set binary and ternary modes for Robinson-Fisher output. Index: fisher.c =================================================================== RCS file: /cvsroot/bogofilter/bogofilter/fisher.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- fisher.c 13 Jan 2003 15:40:17 -0000 1.19 +++ fisher.c 22 Jan 2003 20:22:19 -0000 1.20 @@ -119,7 +119,9 @@ if ( fis_stats.s.spamicity >= spam_cutoff ) return RC_SPAM; - if (ham_cutoff < EPS || (fis_stats.s.spamicity - ham_cutoff < EPS)) + if (twostate || + (ham_cutoff < EPS) || + (fis_stats.s.spamicity - ham_cutoff < EPS)) return RC_HAM; return RC_UNSURE; Index: config.c =================================================================== RCS file: /cvsroot/bogofilter/bogofilter/config.c,v retrieving revision 1.94 retrieving revision 1.95 diff -u -d -r1.94 -r1.95 --- config.c 22 Jan 2003 03:04:20 -0000 1.94 +++ config.c 22 Jan 2003 20:22:19 -0000 1.95 @@ -412,6 +412,8 @@ "\t-f\t- select Fisher spam calculation method.\n" #endif #endif + "\t-2\t- set binary classification mode (yes/no).\n" + "\t-3\t- set ternary classification mode (yes/no/unsure).\n" "\t-p\t- passthrough.\n" "\t-I file\t- read message from 'file' instead of stdin.\n" "\t-O file\t- save message to 'file' in passthrough mode.\n" @@ -484,10 +486,16 @@ fpin = stdin; - while ((option = getopt(argc, argv, "d:eFhl::o:snSNvVpuc:CgrRx:fqtI:O:y:k:" G R F)) != EOF) + while ((option = getopt(argc, argv, "23d:eFhl::o:snSNvVpuc:CgrRx:fqtI:O:y:k:" G R F)) != EOF) { switch(option) { + case '2': + case '3': + twostate = option == '2'; + threestate = option == '3'; + break; + case 'd': xfree(directory); directory = xstrdup(optarg); Index: globals.c =================================================================== RCS file: /cvsroot/bogofilter/bogofilter/globals.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- globals.c 19 Jan 2003 15:01:57 -0000 1.3 +++ globals.c 22 Jan 2003 20:22:19 -0000 1.4 @@ -17,6 +17,8 @@ /* exports */ /* command line options */ +bool twostate; /* '-2' */ +bool threestate; /* '-3' */ bool nonspam_exits_zero; /* '-e' */ bool force; /* '-F' */ bool fisher; /* '-f' */ @@ -29,8 +31,6 @@ FILE *fpin = NULL; /* '-I' */ int Rtable = 0; /* '-R' */ - -extern char outfname[PATH_LEN]; /* '-O' */ /* config file options */ int max_repeats; Index: globals.h =================================================================== RCS file: /cvsroot/bogofilter/bogofilter/globals.h,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- globals.h 19 Jan 2003 15:01:57 -0000 1.27 +++ globals.h 22 Jan 2003 20:22:19 -0000 1.28 @@ -14,6 +14,8 @@ #endif /* command line options */ +extern bool twostate; /* '-2' */ +extern bool threestate; /* '-3' */ extern bool nonspam_exits_zero; /* '-e' */ extern bool fisher; /* '-f' */ extern bool force; /* '-F' */ @@ -32,9 +34,11 @@ /* config file options */ extern int max_repeats; extern double min_dev; +extern double ham_cutoff; extern double spam_cutoff; extern double thresh_stats; +extern int abort_on_error; extern bool stats_in_header; extern const char *update_dir; |