31 #include <string_view>
36 TermGenerator::TermGenerator(
const TermGenerator &) =
default;
59 internal->stopper = stopper;
66 internal->cur_pos = 0;
85 internal->flags =
flags((old_flags & mask) ^ toggle);
92 internal->strategy = strategy;
98 internal->stop_mode = strategy;
104 internal->max_word_length = max_word_length;
112 internal->index_text(itor, weight, prefix,
true);
120 internal->index_text(itor, weight, prefix,
false);
126 internal->cur_pos += delta;
132 return internal->cur_pos;
144 internal->pos_limit = termpos_limit;
150 string s(
"Xapian::TermGenerator(stem=");
151 s +=
internal->stemmer.get_description();
153 s +=
", stopper set";
156 s +=
internal->doc.get_description();
Class representing a document.
Class representing a stemming algorithm.
Abstract base class for stop-word decision functor.
Xapian::Internal::opt_intrusive_ptr< const Stopper > stopper
Parses a piece of text and generate terms.
~TermGenerator()
Destructor.
void set_max_word_length(unsigned max_word_length)
Set the maximum length word to index.
void set_stopper_strategy(stop_strategy strategy)
Set the stopper strategy.
const Xapian::Document & get_document() const
Get the current document.
Xapian::Internal::intrusive_ptr_nonnull< Internal > internal
void index_text(const Xapian::Utf8Iterator &itor, Xapian::termcount wdf_inc=1, std::string_view prefix={})
Index some text.
void set_termpos(Xapian::termpos termpos)
Set the current term position.
stem_strategy
Stemming strategies, for use with set_stemming_strategy().
void set_document(const Xapian::Document &doc)
Set the current document.
flags set_flags(flags toggle, flags mask=flags(0))
Set flags.
void increase_termpos(Xapian::termpos delta=100)
Increase the term position used by index_text.
std::string get_description() const
Return a string describing this object.
int flags
For backward compatibility with Xapian 1.2.
void set_termpos_limit(Xapian::termpos termpos_limit)
Set the term position limit.
stop_strategy
Stopper strategies, for use with set_stopper_strategy().
void set_stopper(const Xapian::Stopper *stop=NULL)
Set the Xapian::Stopper object to be used for identifying stopwords.
void set_database(const Xapian::WritableDatabase &db)
Set the database to index spelling data to.
void set_stemming_strategy(stem_strategy strategy)
Set the stemming strategy.
void index_text_without_positions(const Xapian::Utf8Iterator &itor, Xapian::termcount wdf_inc=1, std::string_view prefix={})
Index some text without positional information.
Xapian::termpos get_termpos() const
Get the current term position.
void set_stemmer(const Xapian::Stem &stemmer)
Set the Xapian::Stem object to be used for generating stemmed terms.
An iterator which returns Unicode character values from a UTF-8 encoded string.
This class provides read/write access to a database.
string str(int value)
Convert int to std::string.
The Xapian namespace contains public interfaces for the Xapian library.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
unsigned XAPIAN_TERMPOS_BASE_TYPE termpos
A term position within a document or query.
static Xapian::Stem stemmer
Convert types to std::string.
parse free text and generate terms
TermGenerator class internals.
Unicode and UTF-8 related classes and functions.