xapian-core  1.5.1
Xapian::Point Class Reference

Class to represent a document as a point in the Vector Space Model. More...

#include <cluster.h>

Inheritance diagram for Xapian::Point:

Public Member Functions

 Point (const FreqSource &freqsource, const Document &document)
 Constructor Initialise the point with terms and corresponding TF-IDF weights.
Document get_document () const
 Returns the document corresponding to this Point.
Public Member Functions inherited from Xapian::PointType
 PointType ()
 Default constructor.
TermIterator termlist_begin () const
 Return a TermIterator to the beginning of the termlist.
TermIterator termlist_end () const noexcept
 Return a TermIterator to the end of the termlist.
bool contains (std::string_view term) const
 Validate whether a certain term exists in the termlist or not by performing a lookup operation in the existing values.
double get_weight (std::string_view term) const
 Return the TF-IDF weight associated with a certain term.
void add_weight (std::string_view term, double weight)
 Add the weight 'weight' to the mapping of a term.
double get_magnitude () const
 Return the pre-computed squared magnitude.
Xapian::termcount termlist_size () const
 Return the size of the termlist.
PointTyperelease ()
 Start reference counting this object.
const PointTyperelease () const
 Start reference counting this object.

Additional Inherited Members

Protected Member Functions inherited from Xapian::PointType
void set_weight (std::string_view term, double weight)
 Set the weight 'weight' to the mapping of a term.
Protected Attributes inherited from Xapian::PointType
std::unordered_map< std::string, double > weights
 Implement a map to store the terms within a document and their pre-computed TF-IDF weights.
double magnitude = 0.0
 Store the squared magnitude of the PointType.

Detailed Description

Class to represent a document as a point in the Vector Space Model.

Constructor & Destructor Documentation

◆ Point()

Xapian::Point::Point ( const FreqSource & freqsource,
const Document & document )

Constructor Initialise the point with terms and corresponding TF-IDF weights.

Parameters
freqsourceFreqSource object which provides the term frequencies. It is used for TF-IDF weight calculations
documentThe Document object over which the Point object will be initialised

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