18 #define MAX_TERM_LENGTH 1024 35 std::string workspace;
68 bool cvc(
const char *what)
70 return ((strchr(
"aeiouwxy", *what) == NULL) && (
isvowely(what + 1)) && (!
isvowely(what + 2))) ? true :
false;
82 size_t length(
const char *reversed);
134 virtual size_t tostem(
char *destination,
const char *source,
size_t source_length);
virtual size_t tostem(char *destination, const char *source, size_t source_length)=0
Stem from source into destination.
Baseclass for stemming algorithms.
Definition: stem.h:26
virtual size_t tostem(char *destination, const char *source, size_t source_length)
Stem from source into destination.
Definition: stem_porter.cpp:72
virtual ~stem_porter()
Detructor.
Definition: stem_porter.h:103
bool cvc(const char *what)
Porter's "*o" rule, the stem ends cvc, where the second c is not W, X or Y (e.g. -WIL, -HOP).
Definition: stem_porter.h:68
static void unittest(void)
Unit test this class.
Definition: stem_porter.cpp:326
static int isvowel(uint8_t c)
Is this character a vowel (i.e. in {aeiouAEIOU})
Definition: ascii.h:260
bool has_vowel(const char *what)
Does the string contain a vowel?
Definition: stem_porter.cpp:56
virtual std::string name(void)
Return the name of the stemming algorithm.
Definition: stem_porter.h:116
Generate the stem of a word using Porter's algorithm (version 1)
Definition: stem_porter.h:32
size_t length(const char *reversed)
Return Porter's m in [C](VC)m[V], the length of the stem.
Definition: stem_porter.cpp:19
Definition: compress_integer_elias_delta_simd.c:23
bool isvowely(const char *c)
Is the character at this point a vowel according to Porter's definision.
Definition: stem_porter.h:53
fast locale-ignoring version of the C runtime library ctype methods for plain 7-bit ASCII...