OmDocumentTerm Class Reference

A term in a document. More...

#include <documentterm.h>

List of all members.

Public Types

typedef vector< Xapian::termposterm_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.


Detailed Description

A term in a document.

Definition at line 36 of file documentterm.h.


Member Typedef Documentation

typedef vector<Xapian::termpos> OmDocumentTerm::term_positions

Definition at line 59 of file documentterm.h.


Constructor & Destructor Documentation

OmDocumentTerm::OmDocumentTerm ( const string &  tname_,
Xapian::termcount  wdf_ 
) [inline]

Make a new term.

Parameters:
tname_ The name of the new term.
wdf_ Initial wdf.

Definition at line 43 of file documentterm.h.

References DEBUGAPICALL.


Member Function Documentation

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.

Parameters:
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.

Exceptions:
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]

Increase the wdf.

Definition at line 99 of file documentterm.h.

References wdf.

void OmDocumentTerm::dec_wdf ( Xapian::termcount  dec  )  [inline]

Decrease the wdf.

Definition at line 102 of file documentterm.h.

References wdf.

Xapian::termcount OmDocumentTerm::get_wdf (  )  [inline]

Get the wdf.

Definition at line 111 of file documentterm.h.

References wdf.

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.


Member Data Documentation

string OmDocumentTerm::tname

The name of this term.

Definition at line 52 of file documentterm.h.

Xapian::termcount OmDocumentTerm::wdf

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().

term_positions OmDocumentTerm::positions

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().


The documentation for this class was generated from the following files:
Documentation for Xapian (version 1.0.10).
Generated on 24 Dec 2008 by Doxygen 1.5.2.