diff options
Diffstat (limited to 'src/classifiers/classifiers.h')
-rw-r--r-- | src/classifiers/classifiers.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/classifiers/classifiers.h b/src/classifiers/classifiers.h index 717083452..c70a71cc6 100644 --- a/src/classifiers/classifiers.h +++ b/src/classifiers/classifiers.h @@ -5,6 +5,7 @@ #include "mem_pool.h" #include "statfile.h" #include "tokenizers/tokenizers.h" +#include <lua.h> /* Consider this value as 0 */ #define ALPHA 0.0001 @@ -17,7 +18,6 @@ struct classifier_ctx { GHashTable *results; gboolean debug; struct classifier_config *cfg; - GMutex *mtx; }; struct classify_weight { @@ -29,12 +29,12 @@ struct classify_weight { struct classifier { char *name; struct classifier_ctx* (*init_func)(memory_pool_t *pool, struct classifier_config *cf); - gboolean (*classify_func)(struct classifier_ctx* ctx, statfile_pool_t *pool, GTree *input, struct worker_task *task); + gboolean (*classify_func)(struct classifier_ctx* ctx, statfile_pool_t *pool, GTree *input, struct worker_task *task, lua_State *L); gboolean (*learn_func)(struct classifier_ctx* ctx, statfile_pool_t *pool, const char *symbol, GTree *input, gboolean in_class, double *sum, double multiplier, GError **err); gboolean (*learn_spam_func)(struct classifier_ctx* ctx, statfile_pool_t *pool, - GTree *input, struct worker_task *task, gboolean is_spam, GError **err); + GTree *input, struct worker_task *task, gboolean is_spam, lua_State *L, GError **err); GList* (*weights_func)(struct classifier_ctx* ctx, statfile_pool_t *pool, GTree *input, struct worker_task *task); }; @@ -43,20 +43,20 @@ struct classifier* get_classifier (char *name); /* Winnow algorithm */ struct classifier_ctx* winnow_init (memory_pool_t *pool, struct classifier_config *cf); -gboolean winnow_classify (struct classifier_ctx* ctx, statfile_pool_t *pool, GTree *input, struct worker_task *task); +gboolean winnow_classify (struct classifier_ctx* ctx, statfile_pool_t *pool, GTree *input, struct worker_task *task, lua_State *L); gboolean winnow_learn (struct classifier_ctx* ctx, statfile_pool_t *pool, const char *symbol, GTree *input, gboolean in_class, double *sum, double multiplier, GError **err); gboolean winnow_learn_spam (struct classifier_ctx* ctx, statfile_pool_t *pool, - GTree *input, struct worker_task *task, gboolean is_spam, GError **err); + GTree *input, struct worker_task *task, gboolean is_spam, lua_State *L, GError **err); GList *winnow_weights (struct classifier_ctx* ctx, statfile_pool_t *pool, GTree *input, struct worker_task *task); /* Bayes algorithm */ struct classifier_ctx* bayes_init (memory_pool_t *pool, struct classifier_config *cf); -gboolean bayes_classify (struct classifier_ctx* ctx, statfile_pool_t *pool, GTree *input, struct worker_task *task); +gboolean bayes_classify (struct classifier_ctx* ctx, statfile_pool_t *pool, GTree *input, struct worker_task *task, lua_State *L); gboolean bayes_learn (struct classifier_ctx* ctx, statfile_pool_t *pool, const char *symbol, GTree *input, gboolean in_class, double *sum, double multiplier, GError **err); gboolean bayes_learn_spam (struct classifier_ctx* ctx, statfile_pool_t *pool, - GTree *input, struct worker_task *task, gboolean is_spam, GError **err); + GTree *input, struct worker_task *task, gboolean is_spam, lua_State *L, GError **err); GList *bayes_weights (struct classifier_ctx* ctx, statfile_pool_t *pool, GTree *input, struct worker_task *task); /* Array of all defined classifiers */ extern struct classifier classifiers[]; |