aboutsummaryrefslogtreecommitdiff
path: root/xapian
diff options
context:
space:
mode:
authorArun Isaac2022-10-16 00:24:27 +0530
committerArun Isaac2022-10-17 01:45:29 +0530
commit2ff796c8c20a3856fede41a06f84a4adb2299d49 (patch)
treeb4f0b0cd16c308f13e71cc6c2a93a501016c74ce /xapian
parente8ce02264f3e797bcd124efb51a28322d0cd2cee (diff)
downloadguile-xapian-2ff796c8c20a3856fede41a06f84a4adb2299d49.tar.gz
guile-xapian-2ff796c8c20a3856fede41a06f84a4adb2299d49.tar.lz
guile-xapian-2ff796c8c20a3856fede41a06f84a4adb2299d49.zip
xapian: Add docstring to mset-snippet.
* xapian/xapian.scm (mset-snippet): Add docstring.
Diffstat (limited to 'xapian')
-rw-r--r--xapian/xapian.scm31
1 files changed, 31 insertions, 0 deletions
diff --git a/xapian/xapian.scm b/xapian/xapian.scm
index 75924ae..f13365e 100644
--- a/xapian/xapian.scm
+++ b/xapian/xapian.scm
@@ -204,6 +204,37 @@ on the database object."
(background-model? #t) (exhaustive? #t)
(empty-without-match? #t)
(cjk-ngram? #t))
+ "Generate a snippet from @var{text}. @var{mset} is the xapian
+@code{MSet} object representing a list of search results.
+
+@var{length} is the number of bytes of @var{text} to aim to select.
+
+The same stemmer used to build the query should be specified as
+@var{stemmer}.
+
+@var{highlight-start} and @var{highlight-end} are inserted
+respectively before and after the highlit terms.
+
+If the chosen snippet seems to start or end mid-sentence, then
+@var{omit} is prepended or appended to indicate this.
+
+If @var{background-model?} is @code{#true}, the relevance of non-query
+terms are modelled to prefer snippets containing a more interesting
+background.
+
+If @var{exhaustive?} is @code{#true}, exhaustively evaluate candidate
+snippets. Else, snippet generation will stop once a @emph{good enough}
+snippet has been found.
+
+If @var{empty-without-match?} is @code{#true}, return the empty string
+if not a single term was found in @var{text}. Else, return a substring
+of text without any highlit terms.
+
+If @var{cjk-ngram?} is @code{#true}, enable generation of n-grams from
+CJK text.
+
+See @code{MSet::snippet} in @file{xapian/mset.h} of the xapian source
+for more details."
(MSet-snippet mset text length stemmer
(bitwise-ior (get-flag MSet-SNIPPET-BACKGROUND-MODEL background-model?)
(get-flag MSet-SNIPPET-EXHAUSTIVE exhaustive?)