From 76e54009be46b03589a043a4433e71ba11c98338 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 23 Apr 2012 16:48:06 +0200 Subject: [PATCH 1/1] relevance: save CCL field per term --- src/relevance.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/relevance.c b/src/relevance.c index 87f5b24..a365ebd 100644 --- a/src/relevance.c +++ b/src/relevance.c @@ -40,6 +40,7 @@ struct relevance struct word_entry { const char *norm_str; int termno; + char *ccl_field; struct word_entry *next; }; @@ -89,6 +90,7 @@ static void pull_terms(struct relevance *res, struct ccl_rpn_node *n) { char **words; int numwords; + char *ccl_field; int i; switch (n->kind) @@ -105,6 +107,8 @@ static void pull_terms(struct relevance *res, struct ccl_rpn_node *n) for (i = 0; i < numwords; i++) { const char *norm_str; + + ccl_field = nmem_strdup_null(res->nmem, n->u.t.qual); pp2_charset_token_first(res->prt, words[i], 0); while ((norm_str = pp2_charset_token_next(res->prt))) @@ -114,6 +118,7 @@ static void pull_terms(struct relevance *res, struct ccl_rpn_node *n) e = &(*e)->next; *e = nmem_malloc(res->nmem, sizeof(**e)); (*e)->norm_str = nmem_strdup(res->nmem, norm_str); + (*e)->ccl_field = ccl_field; (*e)->termno = res->vec_len++; (*e)->next = 0; } -- 1.7.10.4