#include <documentterm.h>
Public Types | |
typedef vector< Xapian::termpos > | term_positions |
Public Member Functions | |
OmDocumentTerm (const string &tname_, Xapian::termcount wdf_) | |
Make a new term. | |
void | add_position (Xapian::termpos tpos) |
Add a position to the posting list. | |
void | remove_position (Xapian::termpos tpos) |
Remove an entry from the posting list. | |
void | inc_wdf (Xapian::termcount inc) |
Increase the wdf. | |
void | dec_wdf (Xapian::termcount dec) |
Decrease the wdf. | |
Xapian::termcount | get_wdf () |
Get the wdf. | |
string | get_description () const |
Return a string describing this object. | |
Public Attributes | |
string | tname |
The name of this term. | |
Xapian::termcount | wdf |
Within document frequency of the term. | |
term_positions | positions |
Positional information. |
Definition at line 36 of file documentterm.h.
typedef vector<Xapian::termpos> OmDocumentTerm::term_positions |
Definition at line 59 of file documentterm.h.
OmDocumentTerm::OmDocumentTerm | ( | const string & | tname_, | |
Xapian::termcount | wdf_ | |||
) | [inline] |
Make a new term.
tname_ | The name of the new term. | |
wdf_ | Initial wdf. |
Definition at line 43 of file documentterm.h.
References DEBUGAPICALL.
void OmDocumentTerm::add_position | ( | Xapian::termpos | tpos | ) |
Add a position to the posting list.
This adds an entry to the list of positions, unless there is already one for the specified position.
This does not change the value of the wdf.
tpos | The position within the document at which the term occurs. |
Definition at line 210 of file omdocument.cc.
References DEBUGAPICALL, and positions.
void OmDocumentTerm::remove_position | ( | Xapian::termpos | tpos | ) |
Remove an entry from the posting list.
This removes an entry from the list of positions.
This does not change the value of the wdf.
Xapian::InvalidArgumentError | is thrown if the |
Definition at line 231 of file omdocument.cc.
References DEBUGAPICALL, om_tostring(), and positions.
void OmDocumentTerm::inc_wdf | ( | Xapian::termcount | inc | ) | [inline] |
void OmDocumentTerm::dec_wdf | ( | Xapian::termcount | dec | ) | [inline] |
Xapian::termcount OmDocumentTerm::get_wdf | ( | ) | [inline] |
string OmDocumentTerm::get_description | ( | ) | const |
Return a string describing this object.
Definition at line 250 of file omdocument.cc.
References om_tostring(), positions, and wdf.
string OmDocumentTerm::tname |
Within document frequency of the term.
This is the number of occurrences of the term in the document.
Definition at line 57 of file documentterm.h.
Referenced by dec_wdf(), get_description(), get_wdf(), and inc_wdf().
Positional information.
This is a list of positions at which the term occurs in the document. The list is in strictly increasing order of term position.
The positions start at 1.
Note that, even if positional information is present, the WDF might not be equal to the length of the position list, since a term might occur multiple times at a single position, but will only have one entry in the position list for each position.
Definition at line 74 of file documentterm.h.
Referenced by add_position(), get_description(), and remove_position().