diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-10-06 17:43:17 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-10-06 18:13:04 +0100 |
commit | 34e24051282cab18f3da7a55d247bf61448defda (patch) | |
tree | f564f8ac8ab1b43eb61d6c121818f06c0b57a8f8 /src/libstat/classifiers/lua_classifier.c | |
parent | 11332ebba77d12d62dcc13966ea24379c2ee94b4 (diff) | |
download | rspamd-34e24051282cab18f3da7a55d247bf61448defda.tar.gz rspamd-34e24051282cab18f3da7a55d247bf61448defda.zip |
[Feature] Add a generic lua classifier
Diffstat (limited to 'src/libstat/classifiers/lua_classifier.c')
-rw-r--r-- | src/libstat/classifiers/lua_classifier.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/libstat/classifiers/lua_classifier.c b/src/libstat/classifiers/lua_classifier.c new file mode 100644 index 000000000..dea0f6a24 --- /dev/null +++ b/src/libstat/classifiers/lua_classifier.c @@ -0,0 +1,46 @@ +/*- + * Copyright 2016 Vsevolod Stakhov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "classifiers.h" +#include "cfg_file.h" +#include "stat_internal.h" + +gboolean +lua_classifier_init (rspamd_mempool_t *pool, + struct rspamd_classifier *cl) +{ + cl->cfg->flags |= RSPAMD_FLAG_CLASSIFIER_NO_BACKEND; + + return TRUE; +} +gboolean +lua_classifier_classify (struct rspamd_classifier *ctx, + GPtrArray *tokens, + struct rspamd_task *task) +{ + return TRUE; +} + +gboolean +lua_classifier_learn_spam (struct rspamd_classifier *ctx, + GPtrArray *tokens, + struct rspamd_task *task, + gboolean is_spam, + gboolean unlearn, + GError **err) +{ + return TRUE; +} |