diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-11-30 15:03:00 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-11-30 15:03:00 +0000 |
commit | 8857f667412c2db45c5d346575db3eb1cf398b04 (patch) | |
tree | 46bcc4157c54ee8811f6618760d1f0ae6c8b6624 /src/libmime/lang_detection.c | |
parent | 7fde20c6c535c8bee0ba418fb48cb93b0fe089bb (diff) | |
download | rspamd-8857f667412c2db45c5d346575db3eb1cf398b04.tar.gz rspamd-8857f667412c2db45c5d346575db3eb1cf398b04.zip |
[Minor] Count words based on text words
Diffstat (limited to 'src/libmime/lang_detection.c')
-rw-r--r-- | src/libmime/lang_detection.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libmime/lang_detection.c b/src/libmime/lang_detection.c index f5a175ad8..82e5fc2ff 100644 --- a/src/libmime/lang_detection.c +++ b/src/libmime/lang_detection.c @@ -1665,11 +1665,11 @@ rspamd_language_detector_detect (struct rspamd_task *task, } if (!ret) { - if (part->utf_words->len < default_short_text_limit) { + if (part->nwords < default_short_text_limit) { r = rs_detect_none; msg_debug_lang_det ("text is too short for trigramms detection: " "%d words; at least %d words required", - (int)part->utf_words->len, + (int)part->nwords, (int)default_short_text_limit); rspamd_language_detector_set_language (task, part, "en"); candidates = kh_init (rspamd_candidates_hash); @@ -1728,7 +1728,7 @@ rspamd_language_detector_detect (struct rspamd_task *task, cbd.std = std; cbd.flags = RSPAMD_LANG_FLAG_DEFAULT; - if (part->utf_words->len < default_words / 2) { + if (part->nwords < default_words / 2) { cbd.flags |= RSPAMD_LANG_FLAG_SHORT; } } |