diff options
Diffstat (limited to 'src/libstat/classifiers/classifiers.h')
-rw-r--r-- | src/libstat/classifiers/classifiers.h | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/src/libstat/classifiers/classifiers.h b/src/libstat/classifiers/classifiers.h index 9a30039df..62abb0052 100644 --- a/src/libstat/classifiers/classifiers.h +++ b/src/libstat/classifiers/classifiers.h @@ -9,39 +9,32 @@ struct rspamd_classifier_config; struct rspamd_task; - -/* Common classifier structure */ -struct classifier_ctx { - rspamd_mempool_t *pool; - GHashTable *results; - gboolean debug; - struct rspamd_classifier_config *cfg; -}; +struct rspamd_classifier; struct token_node_s; struct rspamd_classifier_runtime; struct rspamd_stat_classifier { char *name; - struct classifier_ctx * (*init_func)(rspamd_mempool_t *pool, - struct rspamd_classifier_config *cf); - gboolean (*classify_func)(struct classifier_ctx * ctx, + void (*init_func)(rspamd_mempool_t *pool, + struct rspamd_classifier *cl); + gboolean (*classify_func)(struct rspamd_classifier * ctx, GTree *input, struct rspamd_classifier_runtime *rt, struct rspamd_task *task); - gboolean (*learn_spam_func)(struct classifier_ctx * ctx, + gboolean (*learn_spam_func)(struct rspamd_classifier * ctx, GTree *input, struct rspamd_classifier_runtime *rt, struct rspamd_task *task, gboolean is_spam, GError **err); }; /* Bayes algorithm */ -struct classifier_ctx * bayes_init (rspamd_mempool_t *pool, - struct rspamd_classifier_config *cf); -gboolean bayes_classify (struct classifier_ctx * ctx, +void bayes_init (rspamd_mempool_t *pool, + struct rspamd_classifier *); +gboolean bayes_classify (struct rspamd_classifier * ctx, GTree *input, struct rspamd_classifier_runtime *rt, struct rspamd_task *task); -gboolean bayes_learn_spam (struct classifier_ctx * ctx, +gboolean bayes_learn_spam (struct rspamd_classifier * ctx, GTree *input, struct rspamd_classifier_runtime *rt, struct rspamd_task *task, |