aboutsummaryrefslogtreecommitdiffstats
path: root/src/classifiers/classifiers.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/classifiers/classifiers.h')
-rw-r--r--src/classifiers/classifiers.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/classifiers/classifiers.h b/src/classifiers/classifiers.h
new file mode 100644
index 000000000..eb5e5de4e
--- /dev/null
+++ b/src/classifiers/classifiers.h
@@ -0,0 +1,33 @@
+#ifndef CLASSIFIERS_H
+#define CLASSIFIERS_H
+
+#include <sys/types.h>
+#include "../config.h"
+
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#include "../mem_pool.h"
+#include "../statfile.h"
+#include "../tokenizers/tokenizers.h"
+
+/* Common classifier structure */
+struct classifier {
+ char *name;
+ double (*classify_func)(statfile_pool_t *pool, char *statfile, GTree *input);
+ void (*learn_func)(statfile_pool_t *pool, char *statfile, GTree *input, int in_class);
+};
+
+/* Get classifier structure by name or return NULL if this name is not found */
+struct classifier* get_classifier (char *name);
+/* Winnow algorithm */
+double winnow_classify (statfile_pool_t *pool, char *statfile, GTree *input);
+void winnow_learn (statfile_pool_t *pool, char *statfile, GTree *input, int in_class);
+
+/* Array of all defined classifiers */
+extern struct classifier classifiers[];
+
+#endif
+/*
+ * vi:ts=4
+ */