OmDocumentTerm Class Reference

A term in a document. More...

#include <documentterm.h>

Collaboration diagram for OmDocumentTerm:

Collaboration graph
[legend]

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 position list.
void remove_position (Xapian::termpos tpos)
 Remove an entry from the position list.
void inc_wdf (Xapian::termcount inc)
 Increase the wdf.
void dec_wdf (Xapian::termcount dec)
 Decrease the wdf.
Xapian::termcount get_wdf () const
 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

Definition at line 58 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 LOGCALL_VOID.


Member Function Documentation

void OmDocumentTerm::add_position ( Xapian::termpos  tpos  ) 

Add a position to the position 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 221 of file omdocument.cc.

References LOGCALL_VOID, and positions.

Referenced by Xapian::Document::Internal::add_posting().

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

Decrease the wdf.

Definition at line 102 of file documentterm.h.

References wdf.

string OmDocumentTerm::get_description (  )  const

Return a string describing this object.

Definition at line 261 of file omdocument.cc.

References positions, Xapian::Internal::str(), tname, and wdf.

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

Get the wdf.

Definition at line 111 of file documentterm.h.

References wdf.

void OmDocumentTerm::inc_wdf ( Xapian::termcount  inc  )  [inline]

Increase the wdf.

Definition at line 99 of file documentterm.h.

References wdf.

void OmDocumentTerm::remove_position ( Xapian::termpos  tpos  ) 

Remove an entry from the position 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 position does not occur in the position list.

Definition at line 242 of file omdocument.cc.

References LOGCALL_VOID, positions, Xapian::Internal::str(), and tname.


Member Data Documentation

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 73 of file documentterm.h.

Referenced by add_position(), get_description(), and remove_position().

The name of this term.

Definition at line 51 of file documentterm.h.

Referenced by get_description(), and remove_position().

Within document frequency of the term.

This is the number of occurrences of the term in the document.

Definition at line 56 of file documentterm.h.

Referenced by dec_wdf(), get_description(), get_wdf(), and inc_wdf().


The documentation for this class was generated from the following files:

Documentation for Xapian (version 1.2.13).
Generated on 9 Jan 2013 by Doxygen 1.5.9.