From: Vsevolod Stakhov Date: Mon, 27 Jun 2011 16:26:21 +0000 (+0400) Subject: Fix statshow utility. X-Git-Tag: 0.4.0~39 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e284ad4bdffd09f1f9da7b780bc0c8ead33f2910;p=rspamd.git Fix statshow utility. --- diff --git a/src/classifiers/bayes.c b/src/classifiers/bayes.c index dadd33e5e..af79e0eaa 100644 --- a/src/classifiers/bayes.c +++ b/src/classifiers/bayes.c @@ -47,7 +47,7 @@ struct bayes_statfile_data { guint64 total_hits; double local_probability; double post_probability; - guint value; + guint64 value; struct statfile *st; stat_file_t *file; }; @@ -145,7 +145,7 @@ bayes_classify_callback (gpointer key, gpointer value, gpointer data) cur->post_probability = G_MINDOUBLE * 100; } if (cd->ctx->debug) { - msg_info ("token: %s, statfile: %s, probability: %.4f, post_probability: %.4f", + msg_info ("token: %s, statfile: %s, probability: %uL, post_probability: %.4f", node->extra, cur->st->symbol, cur->value, cur->post_probability); } } diff --git a/utils/statshow/statshow.c b/utils/statshow/statshow.c index a2e8dce68..9a574b80a 100644 --- a/utils/statshow/statshow.c +++ b/utils/statshow/statshow.c @@ -94,7 +94,7 @@ classifiers_callback (gpointer value, void *arg) c.len = strlen (cur->data); if (c.len > 0) { c.begin = cur->data; - if (!cl->tokenizer->tokenize_func (cl->tokenizer, task->task_pool, &c, &tokens, TRUE)) { + if (!cl->tokenizer->tokenize_func (cl->tokenizer, task->task_pool, &c, &tokens, TRUE, FALSE, NULL)) { msg_info ("cannot tokenize input"); return; } @@ -109,7 +109,8 @@ classifiers_callback (gpointer value, void *arg) c.begin = text_part->content->data; c.len = text_part->content->len; /* Tree would be freed at task pool freeing */ - if (!cl->tokenizer->tokenize_func (cl->tokenizer, task->task_pool, &c, &tokens, TRUE)) { + if (!cl->tokenizer->tokenize_func (cl->tokenizer, task->task_pool, &c, &tokens, TRUE, + text_part->is_utf, text_part->urls_offset)) { msg_info ("cannot tokenize input"); return; }