xapian-core  2.0.0
Public Member Functions | Private Attributes | List of all members
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:
+ Collaboration 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. More...
 
Document get_document () const
 Returns the document corresponding to this Point. More...
 
- Public Member Functions inherited from Xapian::PointType
 PointType ()
 Default constructor. More...
 
TermIterator termlist_begin () const
 Return a TermIterator to the beginning of the termlist. More...
 
TermIterator termlist_end () const noexcept
 Return a TermIterator to the end of the termlist. More...
 
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. More...
 
double get_weight (std::string_view term) const
 Return the TF-IDF weight associated with a certain term. More...
 
void add_weight (std::string_view term, double weight)
 Add the weight 'weight' to the mapping of a term. More...
 
double get_magnitude () const
 Return the pre-computed squared magnitude. More...
 
Xapian::termcount termlist_size () const
 Return the size of the termlist. More...
 
PointTyperelease ()
 Start reference counting this object. More...
 
const PointTyperelease () 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 Attributes

Document document
 The document which is being represented by the Point. More...
 

Additional Inherited Members

- Public Attributes inherited from Xapian::Internal::opt_intrusive_base
unsigned _refs
 Reference count. More...
 
- 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. More...
 
- Protected Member Functions inherited from Xapian::Internal::opt_intrusive_base
void release () const
 Start reference counting. More...
 
- 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. More...
 
double magnitude = 0.0
 Store the squared magnitude of the PointType. More...
 

Detailed Description

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

Definition at line 320 of file cluster.h.

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

Member Function Documentation

◆ get_document()

Document Xapian::Point::get_document ( ) const
inline

Returns the document corresponding to this Point.

Definition at line 337 of file cluster.h.

Member Data Documentation

◆ document

Document Xapian::Point::document
private

The document which is being represented by the Point.

Definition at line 322 of file cluster.h.


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