21 #ifndef XAPIAN_INCLUDED_GLASS_SPELLING_H
22 #define XAPIAN_INCLUDED_GLASS_SPELLING_H
32 #include <string_view>
51 operator std::string()
const {
52 return std::string(
data,
data[0] ==
'M' ? 4 : 3);
56 return std::memcmp(
data, b.
data, 4) < 0;
162 :
data(data_),
p(0) { }
std::map< Glass::fragment, std::set< std::string > > termlist_deltas
Changes to make to the termlists.
void cancel(const RootInfo &root_info, glass_revision_number_t rev)
Override methods of GlassTable.
Xapian::termcount remove_word(std::string_view word, Xapian::termcount freqdec)
Xapian::termcount wordfreq_upper_bound
Used to track an upper bound on wordfreq.
std::map< std::string, Xapian::termcount, std::less<> > wordfreq_changes
bool is_modified() const
Override methods of GlassTable.
void merge_changes()
Merge in batched-up changes.
TermList * open_termlist(std::string_view word)
void toggle_fragment(Glass::fragment frag, std::string_view word)
Xapian::termcount flush_db()
Returns updated wordfreq upper bound.
void toggle_word(std::string_view word)
void add_word(std::string_view word, Xapian::termcount freqinc)
GlassSpellingTable(int fd, off_t offset_, bool readonly)
Xapian::doccount get_word_frequency(std::string_view word) const
GlassSpellingTable(const std::string &dbdir, bool readonly)
Create a new GlassSpellingTable object.
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.
std::string data
The encoded data.
GlassSpellingTermList(const GlassSpellingTermList &)
Copying is not allowed.
TermList * skip_to(std::string_view term)
Skip forward to the specified term.
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.
GlassSpellingTermList(const std::string &data_)
Constructor.
unsigned p
Position in the data.
PositionList * positionlist_begin() const
Return PositionList for the current position.
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.
Abstract base class for iterating term positions in a document.
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.