[cvs] bogofilter config.c,1.45,1.46
Fast Bayesian spam filter along lines suggested by Paul Graham
Brought to you by:
m-a
From: <re...@us...> - 2002-11-19 14:14:20
|
Update of /cvsroot/bogofilter/bogofilter In directory sc8-pr-cvs1:/tmp/cvs-serv4960 Modified Files: config.c Log Message: Expand algorithm processing to include Robinson-Fisher method. Change force option from '-f' to '-F'. Add '-t' (terse) option for test output. Use '-f' for specifying Robinson-Fisher algorithm. Index: config.c =================================================================== RCS file: /cvsroot/bogofilter/bogofilter/config.c,v retrieving revision 1.45 retrieving revision 1.46 diff -u -d -r1.45 -r1.46 --- config.c 19 Nov 2002 13:59:58 -0000 1.45 +++ config.c 19 Nov 2002 14:14:17 -0000 1.46 @@ -35,6 +35,9 @@ #ifdef ENABLE_ROBINSON_METHOD #include "robinson.h" #endif +#ifdef ENABLE_ROBINSON_FISHER +#include "fisher.h" +#endif #include "wordlists.h" #include "xmalloc.h" #include "xstrdup.h" @@ -79,7 +82,10 @@ AL_GRAHAM='g', #endif #ifdef ENABLE_ROBINSON_METHOD - AL_ROBINSON='r' + AL_ROBINSON='r', +#endif +#ifdef ENABLE_ROBINSON_FISHER + AL_FISHER='f', #endif }; @@ -131,12 +137,17 @@ { #ifdef ENABLE_GRAHAM_METHOD case AL_GRAHAM: - method = &graham_method; + method = (method_t *) &graham_method; break; #endif #ifdef ENABLE_ROBINSON_METHOD case AL_ROBINSON: - method = &robinson_method; + method = (method_t *) &rf_robinson_method; + break; +#endif +#ifdef ENABLE_ROBINSON_FISHER + case AL_FISHER: + method = (method_t *) &rf_fisher_method; break; #endif default: @@ -389,10 +400,22 @@ (void)printf("details.\n\n"); } -#ifndef GRAHAM_AND_ROBINSON -#define GR +#ifndef ENABLE_GRAHAM_METHOD +#define G "" #else -#define GR "gr" +#define G "g" +#endif + +#ifndef ENABLE_ROBINSON_METHOD +#define R "" +#else +#define R "r" +#endif + +#ifndef ENABLE_ROBINSON_FISHER +#define F "" +#else +#define F "f" #endif int process_args(int argc, char **argv) @@ -400,7 +423,7 @@ int option; int exitcode; - while ((option = getopt(argc, argv, GR "d:ehlsnSNvVpuc:CgrRx:fq")) != EOF) + while ((option = getopt(argc, argv, "d:ehlsnSNvVpuc:CgrRx:fqt" G R F)) != EOF) { switch(option) { @@ -460,6 +483,7 @@ algorithm = AL_GRAHAM; break; #endif + #ifdef ENABLE_ROBINSON_METHOD case 'R': Rtable = 1; @@ -472,6 +496,11 @@ break; #endif +#ifdef ENABLE_ROBINSON_FISHER + case 'f': + algorithm = AL_FISHER; + break; +#endif case 'x': set_debug_mask( optarg ); break; @@ -480,10 +509,11 @@ quiet = 1; break; - case 'f': + case 'F': force = 1; break; + case 'c': read_config_file(optarg, false); /*@fallthrough@*/ @@ -491,6 +521,10 @@ case 'C': suppress_config_file = true; + break; + + case 't': + terse = true; break; default: |