X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=util%2Fsnippet.c;h=10e69c09bfa173db7c20bda88a11ae627e360b98;hb=707cc9ebfa7f462ec58a31cfbad4c1a09fecfa00;hp=b299e5f84724ad6d51356d6aa3ec2f3e07014fed;hpb=6988ba91e363565638c27a8d5895ad9afc409e75;p=idzebra-moved-to-github.git diff --git a/util/snippet.c b/util/snippet.c index b299e5f..10e69c0 100644 --- a/util/snippet.c +++ b/util/snippet.c @@ -1,4 +1,4 @@ -/* $Id: snippet.c,v 1.13 2007-08-21 11:06:47 adam Exp $ +/* $Id: snippet.c,v 1.14 2007-08-21 13:27:04 adam Exp $ Copyright (C) 1995-2007 Index Data ApS @@ -209,6 +209,25 @@ static void zebra_snippets_clear(zebra_snippets *sn) } } +const struct zebra_snippet_word *zebra_snippets_lookup( + const zebra_snippets *doc, const zebra_snippets *hit) +{ + const zebra_snippet_word *hit_w; + for (hit_w = zebra_snippets_constlist(hit); hit_w; hit_w = hit_w->next) + { + const zebra_snippet_word *doc_w; + for (doc_w = zebra_snippets_constlist(doc); doc_w; doc_w = doc_w->next) + { + if (doc_w->ord == hit_w->ord && doc_w->seqno == hit_w->seqno + && !doc_w->ws) + { + return doc_w; + } + } + } + return 0; +} + void zebra_snippets_ring(zebra_snippets *doc, const zebra_snippets *hit, int before, int after) {