From: Vsevolod Stakhov Date: Fri, 22 Jul 2011 11:51:31 +0000 (+0400) Subject: Write error about too few tokens during learning. X-Git-Tag: 0.4.0~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a1e7b9d973818090d02f986b42cbe95fbfb661d5;p=rspamd.git Write error about too few tokens during learning. --- 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; } }