xapian-core  2.0.0
Public Types | Public Member Functions | Private Attributes | List of all members
Xapian::StemStopper Class Reference

Stopper subclass which checks for both stemmed and unstemmed stopwords. More...

#include <cluster.h>

+ Inheritance diagram for Xapian::StemStopper:
+ Collaboration diagram for Xapian::StemStopper:

Public Types

enum  stem_strategy {
  STEM_NONE , STEM_SOME , STEM_ALL , STEM_ALL_Z ,
  STEM_SOME_FULL_POS
}
 Stemming strategies. More...
 

Public Member Functions

 StemStopper (const Xapian::Stem &stemmer, stem_strategy strategy=STEM_SOME)
 Constructor. More...
 
std::string get_description () const override
 Return a string describing this object. More...
 
bool operator() (const std::string &term) const override
 Is term a stop-word? More...
 
void add (std::string_view term)
 Add a single stop word and its stemmed equivalent. More...
 
- Public Member Functions inherited from Xapian::Stopper
 Stopper ()
 Default constructor. More...
 
virtual ~Stopper ()
 Class has virtual methods, so provide a virtual destructor. More...
 
Stopperrelease ()
 Start reference counting this object. More...
 
const Stopperrelease () 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

stem_strategy stem_action
 
std::unordered_set< std::string > stop_words
 
Xapian::Stem stemmer
 

Additional Inherited Members

- Public Attributes inherited from Xapian::Internal::opt_intrusive_base
unsigned _refs
 Reference count. More...
 
- Protected Member Functions inherited from Xapian::Internal::opt_intrusive_base
void release () const
 Start reference counting. More...
 

Detailed Description

Stopper subclass which checks for both stemmed and unstemmed stopwords.

This is intended for use with Xapian::Cluster.

Definition at line 48 of file cluster.h.

Member Enumeration Documentation

◆ stem_strategy

Stemming strategies.

Enumerator
STEM_NONE 
STEM_SOME 
STEM_ALL 
STEM_ALL_Z 
STEM_SOME_FULL_POS 

Definition at line 51 of file cluster.h.

Constructor & Destructor Documentation

◆ StemStopper()

Xapian::StemStopper::StemStopper ( const Xapian::Stem stemmer,
stem_strategy  strategy = STEM_SOME 
)
explicit

Constructor.

Parameters
stemmerThe Xapian::Stem object to set.
strategyThe stemming strategy to be used.

Member Function Documentation

◆ add()

void Xapian::StemStopper::add ( std::string_view  term)

Add a single stop word and its stemmed equivalent.

◆ get_description()

std::string Xapian::StemStopper::get_description ( ) const
overridevirtual

Return a string describing this object.

Reimplemented from Xapian::Stopper.

◆ operator()()

bool Xapian::StemStopper::operator() ( const std::string &  term) const
inlineoverridevirtual

Is term a stop-word?

Parameters
termThe term to test.

Implements Xapian::Stopper.

Definition at line 64 of file cluster.h.

References term.

Member Data Documentation

◆ stem_action

stem_strategy Xapian::StemStopper::stem_action
private

Definition at line 72 of file cluster.h.

◆ stemmer

Xapian::Stem Xapian::StemStopper::stemmer
private

Definition at line 74 of file cluster.h.

◆ stop_words

std::unordered_set<std::string> Xapian::StemStopper::stop_words
private

Definition at line 73 of file cluster.h.


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