Public Member Functions | List of all members
Xapian::Snipper Class Reference

Class used to generate snippets from a given text. More...

Public Member Functions

 Snipper ()
 Default constructor.
 
 Snipper (const Snipper &other)
 Copy constructor.
 
Snipperoperator= (const Snipper &other)
 Assignment.
 
 ~Snipper ()
 Destructor.
 
void set_stemmer (const Xapian::Stem &stemmer)
 Set the stemmer for the Snipper object. More...
 
void set_mset (const MSet &mset, Xapian::doccount rm_docno=10)
 Set the MSet and calculate the relevance model according to it. More...
 
std::string generate_snippet (const std::string &text, size_t length=200, Xapian::termcount window_size=25, double smoothing=0.5)
 Generate snippet from given text. More...
 
std::string get_description () const
 Return a string describing this object.
 

Detailed Description

Class used to generate snippets from a given text.

For generating a snippet, a MSet is needed to calculate a relevance model.

Member Function Documentation

std::string Xapian::Snipper::generate_snippet ( const std::string &  text,
size_t  length = 200,
Xapian::termcount  window_size = 25,
double  smoothing = 0.5 
)

Generate snippet from given text.

Parameters
textThe text from which to generate the snippet
lengthMaximum length of the result in bytes (default: 200)
window_sizeSize of the window (default: 25)
smoothingSmoothing coefficient (default: 0.5)
Returns
Text of the snippet relevant to the model from input.
void Xapian::Snipper::set_mset ( const MSet mset,
Xapian::doccount  rm_docno = 10 
)

Set the MSet and calculate the relevance model according to it.

Parameters
msetMSet with the documents relevant to the query.
rm_docnoMaximum number of documents for the relevance model (default: 10).
void Xapian::Snipper::set_stemmer ( const Xapian::Stem stemmer)

Set the stemmer for the Snipper object.


The documentation for this class was generated from the following file:

Documentation for Xapian (version 1.3.3).
Generated on Tue Jun 2 2015 by Doxygen 1.8.8.