aboutsummaryrefslogtreecommitdiffstats
path: root/src/classifiers/classifiers.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2008-12-04 19:33:26 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2008-12-04 19:33:26 +0300
commit1162170387a535c21a63777c5d73ecbf706d0e02 (patch)
treee09861309abc11030df40987ed30227b71308676 /src/classifiers/classifiers.c
parent249c0583d2a12ddde67e05251e47f256a58cfd05 (diff)
downloadrspamd-1162170387a535c21a63777c5d73ecbf706d0e02.tar.gz
rspamd-1162170387a535c21a63777c5d73ecbf706d0e02.zip
* Add simple implementation of classifiers abstraction and winnow classifier
* Force statfile to work with float values
Diffstat (limited to 'src/classifiers/classifiers.c')
-rw-r--r--src/classifiers/classifiers.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/classifiers/classifiers.c b/src/classifiers/classifiers.c
new file mode 100644
index 000000000..5dab03122
--- /dev/null
+++ b/src/classifiers/classifiers.c
@@ -0,0 +1,28 @@
+/*
+ * Common classifier functions
+ */
+
+#include <sys/types.h>
+#include "classifiers.h"
+
+struct classifier classifiers[] = {
+ {"winnow", winnow_classify, winnow_learn },
+};
+
+struct classifier*
+get_classifier (char *name)
+{
+ int i;
+
+ for (i = 0; i < sizeof (classifiers) / sizeof (classifiers[0]); i ++) {
+ if (strcmp (classifiers[i].name, name) == 0) {
+ return &classifiers[i];
+ }
+ }
+
+ return NULL;
+}
+
+/*
+ * vi:ts=4
+ */