aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstat/classifiers/bayes.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-01-05 15:20:28 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-01-05 15:20:28 +0000
commit603f3664584a2942b718a16a2c303212fdc4871a (patch)
tree4989a602effc84988e1bd378918e615aa02a1108 /src/libstat/classifiers/bayes.c
parent57a464ab523700fc7f2ab3f116724cd198799da8 (diff)
downloadrspamd-603f3664584a2942b718a16a2c303212fdc4871a.tar.gz
rspamd-603f3664584a2942b718a16a2c303212fdc4871a.zip
Start rework
Diffstat (limited to 'src/libstat/classifiers/bayes.c')
-rw-r--r--src/libstat/classifiers/bayes.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/libstat/classifiers/bayes.c b/src/libstat/classifiers/bayes.c
index 180aa4658..a271a424a 100644
--- a/src/libstat/classifiers/bayes.c
+++ b/src/libstat/classifiers/bayes.c
@@ -191,21 +191,13 @@ bayes_normalize_prob (gdouble x)
return a*x4 + b*x3 + c*x2 + d*xx;
}
-struct classifier_ctx *
-bayes_init (rspamd_mempool_t *pool, struct rspamd_classifier_config *cfg)
+void
+bayes_init (rspamd_mempool_t *pool, struct rspamd_classifier *cl)
{
- struct classifier_ctx *ctx =
- rspamd_mempool_alloc (pool, sizeof (struct classifier_ctx));
-
- ctx->pool = pool;
- ctx->cfg = cfg;
- ctx->debug = FALSE;
-
- return ctx;
}
gboolean
-bayes_classify (struct classifier_ctx * ctx,
+bayes_classify (struct rspamd_classifier * ctx,
GTree *input,
struct rspamd_classifier_runtime *rt,
struct rspamd_task *task)
@@ -357,7 +349,7 @@ bayes_learn_ham_callback (gpointer key, gpointer value, gpointer data)
}
gboolean
-bayes_learn_spam (struct classifier_ctx * ctx,
+bayes_learn_spam (struct rspamd_classifier * ctx,
GTree *input,
struct rspamd_classifier_runtime *rt,
struct rspamd_task *task,