]> source.dussan.org Git - rspamd.git/commitdiff
Write error about too few tokens during learning.
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Fri, 22 Jul 2011 11:51:31 +0000 (15:51 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Fri, 22 Jul 2011 11:51:31 +0000 (15:51 +0400)
src/classifiers/bayes.c

index f45f84a3809d180fb8c7359ea2b79d372e5f78cc..5d00505be8ef374275fe397dfb26be18fbbf40fd 100644 (file)
@@ -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;
                }
        }