diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-02-04 10:32:57 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-02-04 10:32:57 +0000 |
commit | 9cf530bdb68ec3bfbfec643bf89fb279983e41a9 (patch) | |
tree | cfef69a21fb516fc65e65d084de83aa797e73c52 /src/libmime/lang_detection.h | |
parent | 5ebcabcff378c0c56ed187c60f941b33d06013d7 (diff) | |
download | rspamd-9cf530bdb68ec3bfbfec643bf89fb279983e41a9.tar.gz rspamd-9cf530bdb68ec3bfbfec643bf89fb279983e41a9.zip |
[Minor] Add diacritics flag for language detector
Diffstat (limited to 'src/libmime/lang_detection.h')
-rw-r--r-- | src/libmime/lang_detection.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/libmime/lang_detection.h b/src/libmime/lang_detection.h index 3eaa4e286..b1382e6ad 100644 --- a/src/libmime/lang_detection.h +++ b/src/libmime/lang_detection.h @@ -50,6 +50,14 @@ enum rspamd_unicode_scripts { RSPAMD_UNICODE_HANGUL = (1 << 16), }; +enum rspamd_language_elt_flags { + RS_LANGUAGE_DEFAULT = 0, + RS_LANGUAGE_LATIN = (1 << 0), + RS_LANGUAGE_TIER1 = (1 << 3), + RS_LANGUAGE_TIER0 = (1 << 4), + RS_LANGUAGE_DIACRITICS = (1 << 5), +}; + struct rspamd_lang_detector_res { gdouble prob; const gchar *lang; @@ -88,7 +96,12 @@ gboolean rspamd_language_detector_detect (struct rspamd_task *task, gboolean rspamd_language_detector_is_stop_word (struct rspamd_lang_detector *d, const gchar *word, gsize wlen); - +/** + * Return language flags for a specific language elt + * @param elt + * @return + */ +gint rspamd_language_detector_elt_flags (const struct rspamd_language_elt *elt); #ifdef __cplusplus } #endif |