From bb28a0c5f71636328d7f48a1a1fad1e07f9b8cd7 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 18 Sep 2012 14:32:29 +0200 Subject: [PATCH] relevance: avoid false hits for whitespace tokens For example, & could be turned into an empty string. And that would occur nowhere else, giving a high inverse document frequency! --- src/relevance.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/relevance.c b/src/relevance.c index b9fc0e1..a3ee82d 100644 --- a/src/relevance.c +++ b/src/relevance.c @@ -50,7 +50,7 @@ static int word_entry_match(struct word_entry *entries, const char *norm_str, { for (; entries; entries = entries->next) { - if (!strcmp(norm_str, entries->norm_str)) + if (*norm_str && !strcmp(norm_str, entries->norm_str)) { const char *cp = 0; int no_read = 0; -- 1.7.10.4