diff options
Diffstat (limited to 'src/classifiers/classifiers.h')
-rw-r--r-- | src/classifiers/classifiers.h | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/classifiers/classifiers.h b/src/classifiers/classifiers.h index 13a295724..fcb251da1 100644 --- a/src/classifiers/classifiers.h +++ b/src/classifiers/classifiers.h @@ -6,29 +6,30 @@ #include "../statfile.h" #include "../tokenizers/tokenizers.h" +struct classifier_config; +struct worker_task; + struct classifier_ctx { memory_pool_t *pool; GHashTable *results; + struct classifier_config *cfg; }; /* Common classifier structure */ struct classifier { char *name; - struct classifier_ctx* (*init_func)(memory_pool_t *pool); - void (*classify_func)(struct classifier_ctx* ctx, statfile_pool_t *pool, - char *statfile, GTree *input, double scale); + struct classifier_ctx* (*init_func)(memory_pool_t *pool, struct classifier_config *cf); + void (*classify_func)(struct classifier_ctx* ctx, statfile_pool_t *pool, GTree *input, struct worker_task *task); void (*learn_func)(struct classifier_ctx* ctx, statfile_pool_t *pool, - char *statfile, GTree *input, int in_class); - char* (*result_file_func)(struct classifier_ctx *ctx, double *probability); + char *symbol, GTree *input, gboolean in_class); }; /* Get classifier structure by name or return NULL if this name is not found */ struct classifier* get_classifier (char *name); /* Winnow algorithm */ -struct classifier_ctx* winnow_init (memory_pool_t *pool); -void winnow_classify (struct classifier_ctx* ctx, statfile_pool_t *pool, char *statfile, GTree *input, double scale); -void winnow_learn (struct classifier_ctx* ctx, statfile_pool_t *pool, char *statfile, GTree *input, int in_class); -char* winnow_result_file (struct classifier_ctx* ctx, double *probability); +struct classifier_ctx* winnow_init (memory_pool_t *pool, struct classifier_config *cf); +void winnow_classify (struct classifier_ctx* ctx, statfile_pool_t *pool, GTree *input, struct worker_task *task); +void winnow_learn (struct classifier_ctx* ctx, statfile_pool_t *pool, char *symbol, GTree *input, gboolean in_class); /* Array of all defined classifiers */ extern struct classifier classifiers[]; |