21 #ifndef XAPIAN_INCLUDED_CHERT_SPELLING_H 22 #define XAPIAN_INCLUDED_CHERT_SPELLING_H 41 explicit fragment(
char data_[4]) { std::memcpy(data, data_, 4); }
44 const char &
operator[] (
unsigned i)
const {
return data[i]; }
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;
56 void toggle_word(
const std::string & word);
57 void toggle_fragment(
fragment frag,
const std::string & word);
82 Z_DEFAULT_STRATEGY) { }
90 TermList * open_termlist(
const std::string & word);
112 wordfreq_changes.clear();
113 termlist_deltas.clear();
141 : data(data_), p(0) { }
145 std::string get_termname()
const;
155 TermList * skip_to(
const std::string & term);
164 #endif // XAPIAN_INCLUDED_CHERT_SPELLING_H The list of words containing a particular trigram.
std::map< std::string, Xapian::termcount > wordfreq_changes
Abstract base class for termlists.
std::string current_term
The current term.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
ChertSpellingTable(const std::string &dbdir, bool readonly)
Create a new ChertSpellingTable object.
std::map< fragment, std::set< std::string > > termlist_deltas
Changes to make to the termlists.
void cancel()
Cancel any outstanding changes.
bool is_modified() const
Determine whether the object contains uncommitted modifications.
Class for iterating over term positions.
std::string data
The encoded data.
bool operator<(const fragment &a, const fragment &b)
void flush_db()
Override methods of ChertTable.
void cancel()
Override methods of ChertTable.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
Subclass of ChertTable for deriving lazy tables from.
Abstract base class for termlists.
ChertSpellingTermList(const std::string &data_)
Constructor.
void flush_db()
Flush any outstanding changes to the DB file of the table.
unsigned p
Position in the data.
char & operator[](unsigned i)
bool is_modified() const
Override methods of ChertTable.