|
JASSv2
|
Generate the stem of a word using Porter's algorithm (version 1) More...
#include <stem_porter.h>


Public Member Functions | |
| virtual | ~stem_porter () |
| Detructor. | |
| virtual std::string | name (void) |
| Return the name of the stemming algorithm. More... | |
| virtual size_t | tostem (char *destination, const char *source, size_t source_length) |
| Stem from source into destination. More... | |
Public Member Functions inherited from JASS::stem | |
| stem () | |
| Constructor. | |
| virtual | ~stem () |
| Destructor. | |
| virtual size_t | tostem (parser::token &destination, const parser::token &source) |
| Stem from term into destination. More... | |
Static Public Member Functions | |
| static void | unittest (void) |
| Unit test this class. | |
Static Public Member Functions inherited from JASS::stem | |
| static void | unittest (void) |
| Unit test this class. | |
Private Member Functions | |
| bool | isvowely (const char *c) |
| Is the character at this point a vowel according to Porter's definision. More... | |
| 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). More... | |
| size_t | length (const char *reversed) |
| Return Porter's m in [C](VC)m[V], the length of the stem. More... | |
| bool | has_vowel (const char *what) |
| Does the string contain a vowel? More... | |
Private Attributes | |
| std::string | workspace |
Generate the stem of a word using Porter's algorithm (version 1)
see: M.F. Porter, An algoritm for suffix stripping, Program, Vol 14, No 3, pp 130-137, July 1980 This code came from ATIRE, and has a few bug fixes applied (especially to rule 1)
|
inlineprivate |
Porter's "*o" rule, the stem ends cvc, where the second c is not W, X or Y (e.g. -WIL, -HOP).
| what | [in] where to check |
|
private |
Does the string contain a vowel?
| what | [in] Where to check. |
|
inlineprivate |
Is the character at this point a vowel according to Porter's definision.
Porter states: "A consonant in a word is a letter other than A, E, I, O or U, and other than Y preceded by a consonant." ... "If a letter is not a consonant it is a vowel." so a vowely is {aeiou} or {y} not folowed by a {aeiou}
| c | [in] Pointer to the character to check. |
|
private |
Return Porter's m in [C](VC)m[V], the length of the stem.
| reversed | [in] The string to count m on. |
|
inlinevirtual |
|
virtual |
Stem from source into destination.
| destination | [out] the result of the steming process (the stem) |
| source | [in] the term to stem |
| source_length | [in] the length of the string to stem |
Implements JASS::stem.
1.8.13