34 TermGenerator::TermGenerator(
const TermGenerator & o) : internal(o.internal) { }
60 internal->stopper = stopper;
67 internal->cur_pos = 0;
86 internal->flags =
flags((old_flags & mask) ^ toggle);
93 internal->strategy = strategy;
99 internal->stop_mode = strategy;
105 internal->max_word_length = max_word_length;
111 const string & prefix)
113 internal->index_text(itor, weight, prefix,
true);
119 const string & prefix)
121 internal->index_text(itor, weight, prefix,
false);
127 internal->cur_pos += delta;
133 return internal->cur_pos;
145 string s(
"Xapian::TermGenerator(stem=");
146 s +=
internal->stemmer.get_description();
148 s +=
", stopper set";
151 s +=
internal->doc.get_description();
Unicode and UTF-8 related classes and functions.
The Xapian namespace contains public interfaces for the Xapian library.
void set_termpos(Xapian::termpos termpos)
Set the current term position.
Xapian::termpos get_termpos() const
Get the current term position.
Class representing a stemming algorithm.
void set_document(const Xapian::Document &doc)
Set the current document.
double weight
The weight of a document or term.
Parses a piece of text and generate terms.
void set_stemming_strategy(stem_strategy strategy)
Set the stemming strategy.
const Xapian::Document & get_document() const
Get the current document.
Convert types to std::string.
static Xapian::Stem stemmer
void index_text(const Xapian::Utf8Iterator &itor, Xapian::termcount wdf_inc=1, const std::string &prefix=std::string())
Index some text.
void set_database(const Xapian::WritableDatabase &db)
Set the database to index spelling data to.
TermGenerator class internals.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
stop_strategy
Stopper strategies, for use with set_stopper_strategy().
TermGenerator & operator=(const TermGenerator &o)
Assignment.
void set_stopper_strategy(stop_strategy strategy)
Set the stopper strategy.
stem_strategy
Stemming strategies, for use with set_stemming_strategy().
This class provides read/write access to a database.
parse free text and generate terms
~TermGenerator()
Destructor.
string str(int value)
Convert int to std::string.
void set_stemmer(const Xapian::Stem &stemmer)
Set the Xapian::Stem object to be used for generating stemmed terms.
int flags
For backward compatibility with Xapian 1.2.
std::string get_description() const
Return a string describing this object.
void set_stopper(const Xapian::Stopper *stop=NULL)
Set the Xapian::Stopper object to be used for identifying stopwords.
void increase_termpos(Xapian::termpos delta=100)
Increase the term position used by index_text.
An iterator which returns Unicode character values from a UTF-8 encoded string.
TermGenerator()
Default constructor.
flags set_flags(flags toggle, flags mask=flags(0))
Set flags.
Xapian::Internal::intrusive_ptr< Internal > internal
unsigned XAPIAN_TERMPOS_BASE_TYPE termpos
A term position within a document or query.
void index_text_without_positions(const Xapian::Utf8Iterator &itor, Xapian::termcount wdf_inc=1, const std::string &prefix=std::string())
Index some text without positional information.
Abstract base class for stop-word decision functor.
void set_max_word_length(unsigned max_word_length)
Set the maximum length word to index.
A handle representing a document in a Xapian database.