diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-01-13 13:49:18 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-01-13 13:49:18 +0000 |
commit | 47d23f7ff0988398a813cc340f89783de24f8596 (patch) | |
tree | 58e9fad63ab632da7779e2189feab13c90e6925b /src/libmime/lang_detection.h | |
parent | ea6af2a9940ef79051051e764e430336be73179f (diff) | |
download | rspamd-47d23f7ff0988398a813cc340f89783de24f8596.tar.gz rspamd-47d23f7ff0988398a813cc340f89783de24f8596.zip |
[Project] Add random words selection logic
Diffstat (limited to 'src/libmime/lang_detection.h')
-rw-r--r-- | src/libmime/lang_detection.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libmime/lang_detection.h b/src/libmime/lang_detection.h index c0d05cf1d..f3f16b1ea 100644 --- a/src/libmime/lang_detection.h +++ b/src/libmime/lang_detection.h @@ -23,6 +23,11 @@ struct rspamd_lang_detector; +struct rspamd_lang_detector_res { + gdouble prob; + const gchar *lang; +}; + /** * Create new language detector object using configuration object * @param cfg @@ -40,4 +45,14 @@ void rspamd_language_detector_to_ucs (struct rspamd_lang_detector *d, rspamd_stat_token_t *utf_token, rspamd_stat_token_t *ucs_token); +/** + * Try to detect language of words + * @param d + * @param ucs_tokens + * @param words_len + * @return language code or NULL if language has not been detected + */ +const gchar * rspamd_language_detector_detect (struct rspamd_lang_detector *d, + GPtrArray *ucs_tokens, gsize words_len); + #endif |