21 #ifndef XAPIAN_INCLUDED_CHERT_SPELLING_H
22 #define XAPIAN_INCLUDED_CHERT_SPELLING_H
46 operator std::string ()
const {
47 return std::string(
data,
data[0] ==
'M' ? 4 : 3);
52 return std::memcmp(a.
data, b.
data, 4) < 0;
82 Z_DEFAULT_STRATEGY) { }
141 :
data(data_),
p(0) { }
Subclass of ChertTable for deriving lazy tables from.
bool operator<(const fragment &a, const fragment &b)
void toggle_word(const std::string &word)
std::map< std::string, Xapian::termcount > wordfreq_changes
void cancel()
Override methods of ChertTable.
TermList * open_termlist(const std::string &word)
void flush_db()
Override methods of ChertTable.
std::map< fragment, std::set< std::string > > termlist_deltas
Changes to make to the termlists.
ChertSpellingTable(const std::string &dbdir, bool readonly)
Create a new ChertSpellingTable object.
Xapian::doccount get_word_frequency(const std::string &word) const
void toggle_fragment(fragment frag, const std::string &word)
void remove_word(const std::string &word, Xapian::termcount freqdec)
bool is_modified() const
Override methods of ChertTable.
void add_word(const std::string &word, Xapian::termcount freqinc)
The list of words containing a particular trigram.
Xapian::termcount get_wdf() const
Return the wdf for the term at the current position.
TermList * next()
Advance the current position to the next term in the termlist.
Xapian::termcount get_collection_freq() const
std::string current_term
The current term.
void operator=(const ChertSpellingTermList &)
Assignment is not allowed.
Xapian::PositionIterator positionlist_begin() const
Return a PositionIterator for the current position.
ChertSpellingTermList(const ChertSpellingTermList &)
Copying is not allowed.
std::string get_termname() const
Return the termname at the current position.
TermList * skip_to(const std::string &term)
Skip forward to the specified term.
std::string data
The encoded data.
unsigned p
Position in the data.
Xapian::termcount positionlist_count() const
Return the length of the position list for the current position.
Xapian::doccount get_termfreq() const
Return the term frequency for the term at the current position.
bool at_end() const
Return true if the current position is past the last term in this list.
ChertSpellingTermList(const std::string &data_)
Constructor.
Xapian::termcount get_approx_size() const
Return approximate size of this termlist.
void flush_db()
Flush any outstanding changes to the DB file of the table.
bool is_modified() const
Determine whether the object contains uncommitted modifications.
void cancel()
Cancel any outstanding changes.
Class for iterating over term positions.
Abstract base class for termlists.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
char & operator[](unsigned i)
Abstract base class for termlists.