xapian-core 1.4.29

Public Member Functions | List of all members
Xapian::SimpleStopper Class Reference

Simple implementation of Stopper class - this will suit most users. More...

`#include <queryparser.h>`

Inheritance diagram for Xapian::SimpleStopper:
[legend]

## Public Member Functions
| SimpleStopper ()
| Default constructor.
template<class Iterator >
| SimpleStopper (Iterator begin, Iterator end)
| Initialise from a pair of iterators.
void | add (const std::string &word)
| Add a single stop word.
virtual bool | operator() (const std::string &term) const
| Is term a stop-word?
virtual std::string | get_description () const
| Return a string describing this object.
Public Member Functions inherited from Xapian::Stopper
| Stopper ()
| Default constructor.
virtual | ~Stopper ()
| Class has virtual methods, so provide a virtual destructor.
Stopper * | release ()
| Start reference counting this object.
const Stopper * | release () const
| Start reference counting this object.

## Detailed Description

Simple implementation of Stopper class - this will suit most users.

## Constructor & Destructor Documentation

## ◆ SimpleStopper()

template<class Iterator >

Xapian::SimpleStopper::SimpleStopper | ( | Iterator | begin,
|  | Iterator | end
| ) |  |
| inline

Initialise from a pair of iterators.

Xapian includes stopword list files for many languages. You can initialise from a file like so:

std::ifstream words("stopwords/english/stop.txt");
Xapian::SimplerStopper stopper(std::istream_iterator<std::string>(words), std::istream_iterator<std::string>());

In bindings for other languages it isn't possible to pass a C++ iterator pair, so instead this constructor is wrapped to allow passing a filename.

## Member Function Documentation

## ◆ get_description()

virtual std::string Xapian::SimpleStopper::get_description | ( |  | ) | const
| virtual

Return a string describing this object.

Reimplemented from Xapian::Stopper.

## ◆ operator()()

virtual bool Xapian::SimpleStopper::operator() | ( | const std::string & | term | ) | const
| inline virtual

Is term a stop-word?

Parameters

  term | The term to test.

Implements Xapian::Stopper.

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

- xapian/queryparser.h