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

Abstract class representing a point in the VSM. More...

#include <cluster.h>

+ Inheritance diagram for Xapian::PointType:
+ Collaboration diagram for Xapian::PointType:

Public Member Functions

 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
 

Protected Member Functions

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

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

Additional Inherited Members

- Public Attributes inherited from Xapian::Internal::opt_intrusive_base
unsigned _refs
 Reference count. More...
 

Detailed Description

Abstract class representing a point in the VSM.

Definition at line 224 of file cluster.h.

Constructor & Destructor Documentation

◆ PointType()

Xapian::PointType::PointType ( )
inline

Default constructor.

Definition at line 248 of file cluster.h.

Member Function Documentation

◆ add_weight()

void Xapian::PointType::add_weight ( std::string_view  term,
double  weight 
)
inline

Add the weight 'weight' to the mapping of a term.

Parameters
termTerm to which the weight is to be added
weightWeight which has to be added to the existing mapping of the term

Definition at line 282 of file cluster.h.

References term.

◆ contains()

bool Xapian::PointType::contains ( std::string_view  term) const
inline

Validate whether a certain term exists in the termlist or not by performing a lookup operation in the existing values.

Parameters
termTerm which is to be searched

Definition at line 263 of file cluster.h.

References term.

◆ get_magnitude()

double Xapian::PointType::get_magnitude ( ) const
inline

Return the pre-computed squared magnitude.

Definition at line 287 of file cluster.h.

◆ get_weight()

double Xapian::PointType::get_weight ( std::string_view  term) const
inline

Return the TF-IDF weight associated with a certain term.

Parameters
termTerm for which TF-IDF weight is returned

Definition at line 271 of file cluster.h.

References term.

◆ release() [1/2]

PointType* Xapian::PointType::release ( )
inline

Start reference counting this object.

You can transfer ownership of a dynamically allocated PointType object to Xapian by calling release() and then passing the object to a Xapian method. Xapian will arrange to delete the object once it is no longer required.

Definition at line 299 of file cluster.h.

◆ release() [2/2]

const PointType* Xapian::PointType::release ( ) const
inline

Start reference counting this object.

You can transfer ownership of a dynamically allocated PointType object to Xapian by calling release() and then passing the object to a Xapian method. Xapian will arrange to delete the object once it is no longer required.

Definition at line 311 of file cluster.h.

◆ set_weight()

void Xapian::PointType::set_weight ( std::string_view  term,
double  weight 
)
inlineprotected

Set the weight 'weight' to the mapping of a term.

Parameters
termTerm for which the weight is supposed to be changed
weightThe weight to which the mapping of the term is to be set

Definition at line 242 of file cluster.h.

References term.

◆ termlist_begin()

TermIterator Xapian::PointType::termlist_begin ( ) const

Return a TermIterator to the beginning of the termlist.

◆ termlist_end()

TermIterator Xapian::PointType::termlist_end ( ) const
inlinenoexcept

Return a TermIterator to the end of the termlist.

Definition at line 254 of file cluster.h.

◆ termlist_size()

Xapian::termcount Xapian::PointType::termlist_size ( ) const
inline

Return the size of the termlist.

Definition at line 290 of file cluster.h.

Member Data Documentation

◆ magnitude

double Xapian::PointType::magnitude = 0.0
protected

Store the squared magnitude of the PointType.

Definition at line 233 of file cluster.h.

◆ weights

std::unordered_map<std::string, double> Xapian::PointType::weights
protected

Implement a map to store the terms within a document and their pre-computed TF-IDF weights.

Definition at line 230 of file cluster.h.


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