X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=include%2Fidzebra%2Fsnippet.h;h=fa77bb39fd40514c47fcaee85fdc74cad9a79245;hb=aa76dfa21ba30fe802a5ef6f3907b57ecd7e6c65;hp=a512743e9037c96b5563d9ace7c94063aebdd92f;hpb=4478d785b7769691261005c98063b98a5a5971b3;p=idzebra-moved-to-github.git diff --git a/include/idzebra/snippet.h b/include/idzebra/snippet.h index a512743..fa77bb3 100644 --- a/include/idzebra/snippet.h +++ b/include/idzebra/snippet.h @@ -1,8 +1,5 @@ -/* $Id: snippet.h,v 1.6 2006-08-14 10:40:14 adam Exp $ - Copyright (C) 1995-2006 - Index Data ApS - -This file is part of the Zebra server. +/* This file is part of the Zebra server. + Copyright (C) 1995-2008 Index Data Zebra is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -32,37 +29,59 @@ struct zebra_snippet_word { int ord; char *term; int match; + int mark; + int ws; struct zebra_snippet_word *next; + struct zebra_snippet_word *prev; }; typedef struct zebra_snippets zebra_snippets; typedef struct zebra_snippet_word zebra_snippet_word; YAZ_EXPORT -zebra_snippets *zebra_snippets_create(); +zebra_snippets *zebra_snippets_create(void); YAZ_EXPORT void zebra_snippets_destroy(zebra_snippets *l); YAZ_EXPORT void zebra_snippets_append(zebra_snippets *l, - zint seqno, int ord, const char *term); + zint seqno, int ws, int ord, const char *term); + +YAZ_EXPORT +void zebra_snippets_appendn(zebra_snippets *l, + zint seqno, int ws, int ord, + const char *term, size_t term_len); YAZ_EXPORT void zebra_snippets_append_match(zebra_snippets *l, - zint seqno, int ord, const char *term, + zint seqno, int ws, int ord, + const char *term, size_t term_len, int match); YAZ_EXPORT zebra_snippet_word *zebra_snippets_list(zebra_snippets *l); YAZ_EXPORT -void zebra_snippets_log(zebra_snippets *l, int log_level); +const zebra_snippet_word *zebra_snippets_constlist(const zebra_snippets *l); + +YAZ_EXPORT +void zebra_snippets_log(const zebra_snippets *l, int log_level, int all); YAZ_EXPORT -zebra_snippets *zebra_snippets_window(zebra_snippets *doc, zebra_snippets *hit, +zebra_snippets *zebra_snippets_window(const zebra_snippets *doc, + const zebra_snippets *hit, int window_size); +YAZ_EXPORT +void zebra_snippets_ring(zebra_snippets *doc, const zebra_snippets *hit, + int before, int after); + + +YAZ_EXPORT +const struct zebra_snippet_word *zebra_snippets_lookup( + const zebra_snippets *doc, const zebra_snippets *hit); + YAZ_END_CDECL #endif