21 #ifndef XAPIAN_INCLUDED_GLASS_SPELLING_H
22 #define XAPIAN_INCLUDED_GLASS_SPELLING_H
50 operator std::string()
const {
51 return std::string(
data,
data[0] ==
'M' ? 4 : 3);
55 return std::memcmp(
data, b.
data, 4) < 0;
163 :
data(data_),
p(0) { }
std::map< Glass::fragment, std::set< std::string > > termlist_deltas
Changes to make to the termlists.
TermList * open_termlist(const std::string &word)
void cancel(const RootInfo &root_info, glass_revision_number_t rev)
Override methods of GlassTable.
Xapian::termcount wordfreq_upper_bound
Used to track an upper bound on wordfreq.
bool is_modified() const
Override methods of GlassTable.
void merge_changes()
Merge in batched-up changes.
Xapian::termcount flush_db()
Returns updated wordfreq upper bound.
std::map< std::string, Xapian::termcount > wordfreq_changes
void toggle_fragment(Glass::fragment frag, const std::string &word)
void remove_word(const std::string &word, Xapian::termcount freqdec)
void toggle_word(const std::string &word)
GlassSpellingTable(int fd, off_t offset_, bool readonly)
GlassSpellingTable(const std::string &dbdir, bool readonly)
Create a new GlassSpellingTable object.
void add_word(const std::string &word, Xapian::termcount freqinc)
Xapian::doccount get_word_frequency(const std::string &word) const
void set_wordfreq_upper_bound(Xapian::termcount ub)
The list of words containing a particular trigram.
Xapian::doccount get_termfreq() const
Return the term frequency for the term at the current position.
TermList * skip_to(const std::string &term)
Skip forward to the specified term.
std::string data
The encoded data.
std::string get_termname() const
Return the termname at the current position.
GlassSpellingTermList(const GlassSpellingTermList &)
Copying is not allowed.
Xapian::termcount positionlist_count() const
Return the length of the position list for the current position.
TermList * next()
Advance the current position to the next term in the termlist.
Xapian::termcount get_approx_size() const
Return approximate size of this termlist.
void operator=(const GlassSpellingTermList &)
Assignment is not allowed.
Xapian::PositionIterator positionlist_begin() const
Return a PositionIterator for the current position.
bool at_end() const
Return true if the current position is past the last term in this list.
GlassSpellingTermList(const std::string &data_)
Constructor.
std::string current_term
The current term.
unsigned p
Position in the data.
Xapian::termcount get_wdf() const
Return the wdf for the term at the current position.
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(const RootInfo &root_info, glass_revision_number_t rev)
Cancel any outstanding changes.
Class for iterating over term positions.
Abstract base class for termlists.
uint4 glass_revision_number_t
The revision number of a glass database.
Subclass of GlassTable for deriving lazy tables from.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
XAPIAN_REVISION_TYPE rev
Revision number of a database.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
bool operator<(const fragment &b) const
char & operator[](unsigned i)
Abstract base class for termlists.