aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstat/classifiers/classifiers.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-10-06 17:43:17 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-10-06 18:13:04 +0100
commit34e24051282cab18f3da7a55d247bf61448defda (patch)
treef564f8ac8ab1b43eb61d6c121818f06c0b57a8f8 /src/libstat/classifiers/classifiers.h
parent11332ebba77d12d62dcc13966ea24379c2ee94b4 (diff)
downloadrspamd-34e24051282cab18f3da7a55d247bf61448defda.tar.gz
rspamd-34e24051282cab18f3da7a55d247bf61448defda.zip
[Feature] Add a generic lua classifier
Diffstat (limited to 'src/libstat/classifiers/classifiers.h')
-rw-r--r--src/libstat/classifiers/classifiers.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/libstat/classifiers/classifiers.h b/src/libstat/classifiers/classifiers.h
index 6bafa8507..e30f2153a 100644
--- a/src/libstat/classifiers/classifiers.h
+++ b/src/libstat/classifiers/classifiers.h
@@ -16,7 +16,7 @@ struct token_node_s;
struct rspamd_stat_classifier {
char *name;
- void (*init_func)(rspamd_mempool_t *pool,
+ gboolean (*init_func)(rspamd_mempool_t *pool,
struct rspamd_classifier *cl);
gboolean (*classify_func)(struct rspamd_classifier * ctx,
GPtrArray *tokens,
@@ -30,7 +30,7 @@ struct rspamd_stat_classifier {
};
/* Bayes algorithm */
-void bayes_init (rspamd_mempool_t *pool,
+gboolean bayes_init (rspamd_mempool_t *pool,
struct rspamd_classifier *);
gboolean bayes_classify (struct rspamd_classifier *ctx,
GPtrArray *tokens,
@@ -42,6 +42,20 @@ gboolean bayes_learn_spam (struct rspamd_classifier *ctx,
gboolean unlearn,
GError **err);
+/* Generic lua classifier */
+gboolean lua_classifier_init (rspamd_mempool_t *pool,
+ struct rspamd_classifier *);
+gboolean lua_classifier_classify (struct rspamd_classifier *ctx,
+ GPtrArray *tokens,
+ struct rspamd_task *task);
+gboolean lua_classifier_learn_spam (struct rspamd_classifier *ctx,
+ GPtrArray *tokens,
+ struct rspamd_task *task,
+ gboolean is_spam,
+ gboolean unlearn,
+ GError **err);
+
+
#endif
/*
* vi:ts=4