#include <termgenerator.h>
Collaboration diagram for Xapian::TermGenerator:
Public Types | |
enum | flags { FLAG_SPELLING = 128 } |
Flags to OR together and pass to TermGenerator::set_flags(). More... | |
Public Member Functions | |
TermGenerator (const TermGenerator &o) | |
Copy constructor. | |
TermGenerator & | operator= (const TermGenerator &o) |
Assignment. | |
TermGenerator () | |
Default constructor. | |
~TermGenerator () | |
Destructor. | |
void | set_stemmer (const Xapian::Stem &stemmer) |
Set the Xapian::Stem object to be used for generating stemmed terms. | |
void | set_stopper (const Xapian::Stopper *stop=NULL) |
Set the Xapian::Stopper object to be used for identifying stopwords. | |
void | set_document (const Xapian::Document &doc) |
Set the current document. | |
const Xapian::Document & | get_document () const |
Get the current document. | |
void | set_database (const Xapian::WritableDatabase &db) |
Set the database to index spelling data to. | |
flags | set_flags (flags toggle, flags mask=flags(0)) |
Set flags. | |
void | index_text (const Xapian::Utf8Iterator &itor, Xapian::termcount weight=1, const std::string &prefix="") |
Index some text. | |
void | index_text (const std::string &text, Xapian::termcount weight=1, const std::string &prefix="") |
Index some text in a std::string. | |
void | index_text_without_positions (const Xapian::Utf8Iterator &itor, Xapian::termcount weight=1, const std::string &prefix="") |
Index some text without positional information. | |
void | index_text_without_positions (const std::string &text, Xapian::termcount weight=1, const std::string &prefix="") |
Index some text in a std::string without positional information. | |
void | increase_termpos (Xapian::termcount delta=100) |
Increase the termpos used by index_text by delta. | |
Xapian::termcount | get_termpos () const |
Get the current term position. | |
void | set_termpos (Xapian::termcount termpos) |
Set the current term position. | |
std::string | get_description () const |
Return a string describing this object. | |
Private Attributes | |
Xapian::Internal::RefCntPtr< Internal > | internal |
For internal use only. Reference counted internals. | |
Classes | |
class | Internal |
This module takes a piece of text and parses it to produce words which are then used to generate suitable terms for indexing. The terms generated are suitable for use with Query objects produced by the QueryParser class.
Definition at line 44 of file termgenerator.h.
Flags to OR together and pass to TermGenerator::set_flags().
Definition at line 79 of file termgenerator.h.
TermGenerator::TermGenerator | ( | const TermGenerator & | o | ) |
TermGenerator::TermGenerator | ( | ) |
TermGenerator::~TermGenerator | ( | ) |
TermGenerator & TermGenerator::operator= | ( | const TermGenerator & | o | ) |
void TermGenerator::set_stemmer | ( | const Xapian::Stem & | stemmer | ) |
Set the Xapian::Stem object to be used for generating stemmed terms.
Definition at line 47 of file termgenerator.cc.
References stemmer.
Referenced by main(), and test_termgen1().
void TermGenerator::set_stopper | ( | const Xapian::Stopper * | stop = NULL |
) |
Set the Xapian::Stopper object to be used for identifying stopwords.
Definition at line 53 of file termgenerator.cc.
void TermGenerator::set_document | ( | const Xapian::Document & | doc | ) |
Set the current document.
Definition at line 59 of file termgenerator.cc.
Referenced by main(), test_termgen1(), test_tg_spell1(), and test_tg_spell2().
const Xapian::Document & TermGenerator::get_document | ( | ) | const |
void TermGenerator::set_database | ( | const Xapian::WritableDatabase & | db | ) |
Set the database to index spelling data to.
Definition at line 72 of file termgenerator.cc.
Referenced by test_tg_spell1().
TermGenerator::flags TermGenerator::set_flags | ( | flags | toggle, | |
flags | mask = flags(0) | |||
) |
Set flags.
The new value of flags is: (flags & mask) ^ toggle
To just set the flags, pass the new flags in toggle and the default value for mask.
toggle | Flags to XOR. | |
mask | Flags to AND with first. |
Definition at line 78 of file termgenerator.cc.
Referenced by test_tg_spell1(), and test_tg_spell2().
void TermGenerator::index_text | ( | const Xapian::Utf8Iterator & | itor, | |
Xapian::termcount | weight = 1 , |
|||
const std::string & | prefix = "" | |||
) |
Index some text.
weight | The wdf increment (default 1). | |
prefix | The term prefix to use (default is no prefix). |
Definition at line 86 of file termgenerator.cc.
Referenced by main(), test_termgen1(), test_tg_spell1(), and test_tg_spell2().
void Xapian::TermGenerator::index_text | ( | const std::string & | text, | |
Xapian::termcount | weight = 1 , |
|||
const std::string & | prefix = "" | |||
) | [inline] |
Index some text in a std::string.
weight | The wdf increment (default 1). | |
prefix | The term prefix to use (default is no prefix). |
Definition at line 112 of file termgenerator.h.
void TermGenerator::index_text_without_positions | ( | const Xapian::Utf8Iterator & | itor, | |
Xapian::termcount | weight = 1 , |
|||
const std::string & | prefix = "" | |||
) |
Index some text without positional information.
Just like index_text, but no positional information is generated. This means that the database will be significantly smaller, but that phrase searching and NEAR won't be supported.
Definition at line 94 of file termgenerator.cc.
Referenced by test_termgen1().
void Xapian::TermGenerator::index_text_without_positions | ( | const std::string & | text, | |
Xapian::termcount | weight = 1 , |
|||
const std::string & | prefix = "" | |||
) | [inline] |
Index some text in a std::string without positional information.
Just like index_text, but no positional information is generated. This means that the database will be significantly smaller, but that phrase searching and NEAR won't be supported.
Definition at line 134 of file termgenerator.h.
void TermGenerator::increase_termpos | ( | Xapian::termcount | delta = 100 |
) |
Increase the termpos used by index_text by delta.
This can be used to prevent phrase searches from spanning two unconnected blocks of text (e.g. the title and body text).
Definition at line 102 of file termgenerator.cc.
Referenced by test_termgen1().
Xapian::termcount TermGenerator::get_termpos | ( | ) | const |
void TermGenerator::set_termpos | ( | Xapian::termcount | termpos | ) |
string TermGenerator::get_description | ( | ) | const |
Return a string describing this object.
Definition at line 120 of file termgenerator.cc.
References internal, and om_tostring().
For internal use only.
Reference counted internals.
Definition at line 47 of file termgenerator.h.
Referenced by get_description(), and operator=().