summaryrefslogtreecommitdiffstats
path: root/src/libstat/classifiers/bayes.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstat/classifiers/bayes.c')
-rw-r--r--src/libstat/classifiers/bayes.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libstat/classifiers/bayes.c b/src/libstat/classifiers/bayes.c
index be6c6f545..7932ceb9e 100644
--- a/src/libstat/classifiers/bayes.c
+++ b/src/libstat/classifiers/bayes.c
@@ -221,6 +221,10 @@ bayes_learn_spam_callback (gpointer key, gpointer value, gpointer data)
if (res->st_runtime->st->is_spam) {
res->value ++;
}
+ else if (res->value > 0) {
+ /* Unlearning */
+ res->value --;
+ }
}
return FALSE;
@@ -241,6 +245,9 @@ bayes_learn_ham_callback (gpointer key, gpointer value, gpointer data)
if (!res->st_runtime->st->is_spam) {
res->value ++;
}
+ else if (res->value > 0) {
+ res->value --;
+ }
}
return FALSE;