Browse Source

[Minor] Do not count empty words

tags/2.6
Vsevolod Stakhov 3 years ago
parent
commit
ffdde528bb
2 changed files with 5 additions and 5 deletions
  1. 3
    3
      src/libmime/message.c
  2. 2
    2
      src/libmime/message.h

+ 3
- 3
src/libmime/message.c View File

@@ -93,10 +93,10 @@ rspamd_mime_part_extract_words (struct rspamd_task *task,
if (w->stemmed.len <= 3) {
short_len++;
}
}

if (w->flags & RSPAMD_STAT_TOKEN_FLAG_TEXT) {
part->nwords ++;
if (w->flags & RSPAMD_STAT_TOKEN_FLAG_TEXT) {
part->nwords ++;
}
}

if (w->flags & (RSPAMD_STAT_TOKEN_FLAG_BROKEN_UNICODE|

+ 2
- 2
src/libmime/message.h View File

@@ -140,8 +140,8 @@ struct rspamd_mime_text_part {
GByteArray *utf_content; /* utf8 encoded processed content */
GByteArray *utf_raw_content; /* utf raw content */
GByteArray *utf_stripped_content; /* utf content with no newlines */
GArray *normalized_hashes;
GArray *utf_words;
GArray *normalized_hashes; /* Array of guint64 */
GArray *utf_words; /* Array of rspamd_stat_token_t */
UText utf_stripped_text; /* Used by libicu to represent the utf8 content */

GPtrArray *newlines; /**< positions of newlines in text, relative to content*/

Loading…
Cancel
Save