Class used to generate snippets from a given text. More...
Public Member Functions | |
Snipper () | |
Default constructor. | |
Snipper (const Snipper &other) | |
Copy constructor. | |
Snipper & | operator= (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. | |
Class used to generate snippets from a given text.
For generating a snippet, a MSet is needed to calculate a relevance model.
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.
text | The text from which to generate the snippet |
length | Maximum length of the result in bytes (default: 200) |
window_size | Size of the window (default: 25) |
smoothing | Smoothing coefficient (default: 0.5) |
void Xapian::Snipper::set_mset | ( | const MSet & | mset, |
Xapian::doccount | rm_docno = 10 |
||
) |
void Xapian::Snipper::set_stemmer | ( | const Xapian::Stem & | stemmer | ) |
Set the stemmer for the Snipper object.