diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-01-15 20:23:00 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-01-15 20:23:19 +0000 |
commit | dc77c863434b31c195fd95c9b81b1a25dcc80385 (patch) | |
tree | 2c1f71aad814251ef418f43565c3f7da74810ea6 /src | |
parent | 8f1967692ce69d3a0dd97f806a41fb024ec8216e (diff) | |
download | rspamd-dc77c863434b31c195fd95c9b81b1a25dcc80385.tar.gz rspamd-dc77c863434b31c195fd95c9b81b1a25dcc80385.zip |
[Minor] Another adjustment to lang_detection
Diffstat (limited to 'src')
-rw-r--r-- | src/libmime/lang_detection.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libmime/lang_detection.c b/src/libmime/lang_detection.c index 374e38f83..17042f1a9 100644 --- a/src/libmime/lang_detection.c +++ b/src/libmime/lang_detection.c @@ -751,7 +751,7 @@ rspamd_language_detector_detect (struct rspamd_lang_detector *d, /* Try to improve guess */ tcandidates = g_hash_table_new_full (rspamd_str_hash, rspamd_str_equal, NULL, g_free); - r = rspamd_language_detector_try_ngramm (d, ucs_tokens, rs_bigramm, + r = rspamd_language_detector_try_ngramm (d, ucs_tokens, rs_trigramm, tcandidates); switch (r) { @@ -789,15 +789,16 @@ rspamd_language_detector_detect (struct rspamd_lang_detector *d, g_hash_table_unref (candidates); candidates = tcandidates; - msg_err ("bigramms checked, %.3f mean, %.4f stddev", mean, std); + msg_err ("trigramms checked, %.3f mean, %.4f stddev", mean, std); - if (std / fabs (mean) < 0.3) { + if (std / fabs (mean) < 0.01) { /* Try trigramms */ tcandidates = g_hash_table_new_full (rspamd_str_hash, rspamd_str_equal, NULL, g_free); - r = rspamd_language_detector_try_ngramm (d, ucs_tokens, rs_trigramm, + r = rspamd_language_detector_try_ngramm (d, ucs_tokens, + rs_trigramm, tcandidates); if (r != rs_detect_none) { |