Previous: WordDict DESCRIPTION, Up: WordDict [Contents][Index]
Private constructor.
Bind the object a WordList inverted index. Return OK on success, NOTOK otherwise.
Open the underlying Berkeley DB sub-database. The enclosing
file is given by the
words
data member. Return OK on success,
NOTOK otherwise.
Destroy the underlying Berkeley DB sub-database. Return OK on success, NOTOK otherwise.
Close the underlying Berkeley DB sub-database. Return OK on success, NOTOK otherwise.
If the word argument exists in the dictionnary, return its serial number in the serial argument. If it does not already exists, assign it a serial number, create an entry with a frequency of zero and return the new serial in the serial argument. Return OK on success, NOTOK otherwise.
If the word argument exists in the dictionnary, return its serial number in the serial argument. If it does not exists set the serial argument to WORD_DICT_SERIAL_INVALID. Return OK on success, NOTOK otherwise.
Short hand for Serial() followed by Ref(). Return OK on success, NOTOK otherwise.
Return the frequency of the word argument in the noccurrence argument. Return OK on success, NOTOK otherwise.
Short hand for words->GetContext()->GetType()->Normalize(word). Return OK on success, NOTOK otherwise.
Short hand for Incr(word, 1)
Add incr to the frequency of the word . Return OK on success, NOTOK otherwise.
Short hand for Decr(word, 1)
Subtract decr to the frequency of the word . If the frequency becomes lower or equal to zero, remove the entry from the dictionnary and lose the association between the word and its serial number. Return OK on success, NOTOK otherwise.
Set the frequency of word with the value of the noccurrence argument.
Return true if word exists in the dictionnary, false otherwise.
Return a pointer to the associated WordList object.
Return a cursor to sequentially walk the dictionnary using the Next method.
Return the next entry in the dictionnary. The
cursor
argument
must have been created using the
Cursor
method. The word is
returned in the
word
argument and the record is returned in
the
record
argument.
On success the function returns 0, at the end of the dictionnary it
returns DB_NOTFOUND. The
cursor
argument is deallocated when
the function hits the end of the dictionnary or an error occurs.
Return a cursor to sequentially walk the entries of the dictionnary that start with the prefix argument, using the NextPrefix method.
Return the next prefix from the dictionnary. The
cursor
argument
must have been created using the
CursorPrefix
method. The word is
returned in the
word
argument and the record is returned in
the
record
argument. The
word
is guaranteed to start with
the prefix specified to the
CursorPrefix
method.
On success the function returns 0, at the end of the dictionnary it
returns DB_NOTFOUND. The
cursor
argument is deallocated when
the function hits the end of the dictionnary or an error occurs.
Dump the complete dictionary in the file descriptor
f.
The
format of the dictionary is
word serial frequency
, one by
line.
Previous: WordDict DESCRIPTION, Up: WordDict [Contents][Index]