xapian-core
1.4.26
|
Class representing a stemming algorithm. More...
#include <stem.h>
Public Member Functions | |
Stem (const Stem &o) | |
Copy constructor. More... | |
Stem & | operator= (const Stem &o) |
Assignment. More... | |
Stem () | |
Construct a Xapian::Stem object which doesn't change terms. More... | |
Stem (StemImplementation *p) | |
Construct a Xapian::Stem object with a user-provided stemming algorithm. More... | |
~Stem () | |
Destructor. More... | |
std::string | operator() (const std::string &word) const |
Stem a word. More... | |
bool | is_none () const |
Return true if this is a no-op stemmer. More... | |
std::string | get_description () const |
Return a string describing this object. More... | |
Stem (const std::string &language) | |
Construct a Xapian::Stem object for a particular language. More... | |
Stem (const std::string &language, bool fallback) | |
Construct a Xapian::Stem object for a particular language. More... | |
Static Public Member Functions | |
static std::string | get_available_languages () |
Return a list of available languages. More... | |
Private Attributes | |
Xapian::Internal::intrusive_ptr< StemImplementation > | internal |
Xapian::Stem::Stem | ( | ) |
Construct a Xapian::Stem object which doesn't change terms.
Equivalent to Stem("none").
Definition at line 54 of file stem.cc.
Referenced by operator=().
|
explicit |
Construct a Xapian::Stem object for a particular language.
language | Either the English name for the language or the two letter ISO639 code. |
The following language names are understood (aliases follow the name):
fallback | If true then treat unknown language as "none", otherwise an exception is thrown (default: false). Parameter added in Xapian 1.4.14 - older versions always threw an exception. |
Xapian::InvalidArgumentError | is thrown if language isn't recognised and fallback is false. |
Xapian::Stem::Stem | ( | const std::string & | language, |
bool | fallback | ||
) |
Construct a Xapian::Stem object for a particular language.
language | Either the English name for the language or the two letter ISO639 code. |
The following language names are understood (aliases follow the name):
fallback | If true then treat unknown language as "none", otherwise an exception is thrown (default: false). Parameter added in Xapian 1.4.14 - older versions always threw an exception. |
Xapian::InvalidArgumentError | is thrown if language isn't recognised and fallback is false. |
|
explicit |
Construct a Xapian::Stem object with a user-provided stemming algorithm.
You can subclass Xapian::StemImplementation to implement your own stemming algorithm (or to wrap a third-party algorithm) and then wrap your implementation in a Xapian::Stem object to pass to the Xapian API.
p | The user-subclassed StemImplementation object. This is reference counted, and so will be automatically deleted by the Xapian::Stem wrapper when no longer required. |
|
inlinestatic |
Return a list of available languages.
Each stemmer is only included once in the list (not once for each alias). The name included is the English name of the language.
The list is returned as a string, with language names separated by spaces. This is a static method, so a Xapian::Stem object is not required for this operation.
Definition at line 181 of file stem.h.
References Xapian::Internal::get_constinfo_(), Xapian::Internal::constinfo::stemmer_data, and Xapian::Internal::constinfo::stemmer_name_len.
Referenced by DEFINE_TESTCASE(), and main().
string Xapian::Stem::get_description | ( | ) | const |
Return a string describing this object.
Definition at line 147 of file stem.cc.
Referenced by DEFINE_TESTCASE().
|
inline |
Return true if this is a no-op stemmer.
Definition at line 166 of file stem.h.
Referenced by DEFINE_TESTCASE(), Xapian::TermGenerator::Internal::index_text(), and Xapian::QueryParser::Internal::parse_query().
string Xapian::Stem::operator() | ( | const std::string & | word | ) | const |
|
private |