Thread: [cvs] bogofilter/src bogotune.c,1.118,1.119
Fast Bayesian spam filter along lines suggested by Paul Graham
Brought to you by:
m-a
From: <re...@us...> - 2004-02-26 14:12:23
|
Update of /cvsroot/bogofilter/bogofilter/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32049 Modified Files: bogotune.c Log Message: When building internal wordlist, correct setting of msgs_good and msgs_bad. Index: bogotune.c =================================================================== RCS file: /cvsroot/bogofilter/bogofilter/src/bogotune.c,v retrieving revision 1.118 retrieving revision 1.119 diff -u -d -r1.118 -r1.119 --- bogotune.c 26 Feb 2004 01:39:58 -0000 1.118 +++ bogotune.c 26 Feb 2004 14:04:09 -0000 1.119 @@ -673,16 +673,15 @@ /* training set */ if (divvy && train_count / ratio < score_count + 1) { static wordprop_t *msg_count = NULL; - if (msg_count == NULL) - /* Update .MSG_COUNT */ - msg_count = wordhash_insert(train, w_msg_count, sizeof(wordprop_t), &wordprop_init); - wordhash_set_counts(wh, good, bad); wordhash_add(train, wh, &wordprop_init); train_count += 1; - msg_count->cnts.good += good; - msg_count->cnts.bad += bad; wordhash_free(wh); + + if (msg_count == NULL) /* Update .MSG_COUNT */ + msg_count = wordhash_insert(train, w_msg_count, sizeof(wordprop_t), &wordprop_init); + msgs_good = msg_count->cnts.good += good; + msgs_bad = msg_count->cnts.bad += bad; } /* scoring set */ else { @@ -1344,9 +1343,6 @@ ns_scores = xcalloc(ns_cnt, sizeof(double)); sp_scores = xcalloc(sp_cnt, sizeof(double)); - msgs_good = ns_cnt; - msgs_bad = sp_cnt; - robs = DEFAULT_ROBS; robx = DEFAULT_ROBX; min_dev = DEFAULT_MIN_DEV; |