diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-01-13 20:30:24 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-01-13 20:30:24 +0000 |
commit | 0e9c94dc74205c5c49291a3241bff9b309cb1b48 (patch) | |
tree | 1a7512916e60ecbaf8a456db92b89bd69cfea3cc /src | |
parent | 374afc0e77fdca6bff25c44ebfe467780f461d87 (diff) | |
download | rspamd-0e9c94dc74205c5c49291a3241bff9b309cb1b48.tar.gz rspamd-0e9c94dc74205c5c49291a3241bff9b309cb1b48.zip |
[Minor] Improve trigramms switch
Diffstat (limited to 'src')
-rw-r--r-- | src/libmime/lang_detection.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libmime/lang_detection.c b/src/libmime/lang_detection.c index ead12b8e8..6e3635a95 100644 --- a/src/libmime/lang_detection.c +++ b/src/libmime/lang_detection.c @@ -748,14 +748,14 @@ rspamd_language_detector_detect (struct rspamd_lang_detector *d, gdouble err; cand = (struct rspamd_lang_detector_res *) v; err = cand->prob - mean; - std += err * err; + std += fabs (err); } std /= g_hash_table_size (tcandidates); g_hash_table_unref (candidates); candidates = tcandidates; - if (std < mean / 100) { + if (std / fabs (mean) < 0.3) { /* Try trigramms */ tcandidates = g_hash_table_new_full (rspamd_str_hash, rspamd_str_equal, |