aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-07-22 15:51:31 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-07-22 15:51:31 +0400
commita1e7b9d973818090d02f986b42cbe95fbfb661d5 (patch)
treebb13c0eca5a2d810e5de5781e4caa7ee933e61fd
parent970e7e3b52db9b05112651a19c6dd5789003f437 (diff)
downloadrspamd-a1e7b9d973818090d02f986b42cbe95fbfb661d5.tar.gz
rspamd-a1e7b9d973818090d02f986b42cbe95fbfb661d5.zip
Write error about too few tokens during learning.
-rw-r--r--src/classifiers/bayes.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/classifiers/bayes.c b/src/classifiers/bayes.c
index f45f84a38..5d00505be 100644
--- a/src/classifiers/bayes.c
+++ b/src/classifiers/bayes.c
@@ -371,6 +371,11 @@ bayes_learn_spam (struct classifier_ctx* ctx, statfile_pool_t *pool,
nodes = nodes / FEATURE_WINDOW_SIZE + FEATURE_WINDOW_SIZE;
}
if (nodes < minnodes) {
+ g_set_error (err,
+ bayes_error_quark(), /* error domain */
+ 1, /* error code */
+ "message contains too few tokens: %d, while min is %d",
+ nodes, minnodes);
return FALSE;
}
}