From 2a6a5dc3a9848a0e032486b3a8070f7a65e5f622 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 23 Apr 2012 16:00:20 +0200 Subject: [PATCH] Remove some unused code; reformat --- src/relevance.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/relevance.c b/src/relevance.c index 3eba7cf..014a09f 100644 --- a/src/relevance.c +++ b/src/relevance.c @@ -163,7 +163,7 @@ static void pull_terms(NMEM nmem, struct ccl_rpn_node *n, termlist[(*num)++] = words[i]; } break; - default: // NOOP + default: break; } } @@ -253,7 +253,6 @@ void relevance_prepare_read(struct relevance *rel, struct reclist *reclist) } } // Calculate relevance for each document - while (1) { int t; @@ -263,18 +262,7 @@ void relevance_prepare_read(struct relevance *rel, struct reclist *reclist) break; for (t = 1; t < rel->vec_len; t++) { - float termfreq; -#if 1 - termfreq = (float) rec->term_frequency_vecf[t]; -#else - if (rec->term_frequency_vec[0]) - { - termfreq = (float) - rec->term_frequency_vec[t] / rec->term_frequency_vec[0] ; - } - else - termfreq = 0.0; -#endif + float termfreq = (float) rec->term_frequency_vecf[t]; relevance += 100000 * (termfreq * idfvec[t] + 0.0000005); } rec->relevance_score = relevance; -- 1.7.10.4