xapian-core  2.0.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Xapian::TermListGroup Class Reference

A class for construction of termlists which store the terms for a document along with the number of documents it indexes i.e. More...

#include <cluster.h>

+ Inheritance diagram for Xapian::TermListGroup:
+ Collaboration diagram for Xapian::TermListGroup:

Public Member Functions

 TermListGroup (const MSet &docs, const Stopper *stopper=NULL)
 Constructor. More...
 
doccount get_termfreq (const std::string &tname) const override
 Return the number of documents that the term 'tname' exists in. More...
 
doccount get_doccount () const override
 Return the number of documents within the MSet. More...
 
- Public Member Functions inherited from Xapian::FreqSource
 FreqSource ()
 Default constructor. More...
 
virtual ~FreqSource ()
 Destructor. More...
 
FreqSourcerelease ()
 Start reference counting this object. More...
 
const FreqSourcerelease () const
 Start reference counting this object. More...
 
- Public Member Functions inherited from Xapian::Internal::opt_intrusive_base
 opt_intrusive_base (const opt_intrusive_base &)
 
opt_intrusive_baseoperator= (const opt_intrusive_base &)
 
 opt_intrusive_base ()
 Construct object which is initially not reference counted. More...
 
virtual ~opt_intrusive_base ()
 
void ref () const
 
void unref () const
 

Private Member Functions

void add_document (const Document &document, const Stopper *stopper=NULL)
 Add a single document and calculates its corresponding term frequencies. More...
 

Private Attributes

std::unordered_map< std::string, doccounttermfreq
 Map of the terms and its corresponding term frequencies. More...
 
doccount num_of_documents
 Number of documents added to the termlist. More...
 

Additional Inherited Members

- Public Attributes inherited from Xapian::Internal::opt_intrusive_base
unsigned _refs
 Reference count. More...
 
- Protected Member Functions inherited from Xapian::Internal::opt_intrusive_base
void release () const
 Start reference counting. More...
 

Detailed Description

A class for construction of termlists which store the terms for a document along with the number of documents it indexes i.e.

term frequency

Definition at line 188 of file cluster.h.

Constructor & Destructor Documentation

◆ TermListGroup()

Xapian::TermListGroup::TermListGroup ( const MSet docs,
const Stopper stopper = NULL 
)
explicit

Constructor.

Parameters
docsMSet object used to construct the TermListGroup
stopperXapian::Stopper object to identify stopwords

Member Function Documentation

◆ add_document()

void Xapian::TermListGroup::add_document ( const Document document,
const Stopper stopper = NULL 
)
private

Add a single document and calculates its corresponding term frequencies.

Parameters
documentAdds a document and updates the TermListGroup based on the terms found in the document
stopperXapian::Stopper object to identify stopwords

◆ get_doccount()

doccount Xapian::TermListGroup::get_doccount ( ) const
overridevirtual

Return the number of documents within the MSet.

Implements Xapian::FreqSource.

◆ get_termfreq()

doccount Xapian::TermListGroup::get_termfreq ( const std::string &  tname) const
overridevirtual

Return the number of documents that the term 'tname' exists in.

Parameters
tnameThe term for which to return the term frequency

Implements Xapian::FreqSource.

Member Data Documentation

◆ num_of_documents

doccount Xapian::TermListGroup::num_of_documents
private

Number of documents added to the termlist.

Definition at line 195 of file cluster.h.

◆ termfreq

std::unordered_map<std::string, doccount> Xapian::TermListGroup::termfreq
private

Map of the terms and its corresponding term frequencies.

The term frequency of a term stands for the number of documents it indexes

Definition at line 192 of file cluster.h.


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