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:
[legend]

## Public Member Functions
| 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.
PointType * | release ()
| Start reference counting this object.
const PointType * | release () const
| Start reference counting this object.

## Protected Member Functions
void | set_weight (std::string_view term, double weight)
| Set the weight 'weight' to the mapping of a term.

## 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.
double | magnitude = 0.0
| Store the squared magnitude of the PointType.

## Detailed Description

Abstract class representing a point in the VSM.

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

  term | Term to which the weight is to be added
  weight | Weight which has to be added to the existing mapping of the term

References weights.

## ◆ 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

  term | Term which is to be searched

References weights.

## ◆ get_weight()

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

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

Parameters

  term | Term for which TF-IDF weight is returned

References weights.

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

References PointType().

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

References PointType().

## ◆ set_weight()

void Xapian::PointType::set_weight | ( | std::string_view | term,
|  | double | weight )
| inline protected

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

Parameters

  term | Term for which the weight is supposed to be changed
  weight | The weight to which the mapping of the term is to be set

References weights.

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

- xapian/cluster.h