Stemmer, implementing the Porter Stemming Algorithm
The Stemmer class transforms a word into its root form. The input word can be provided a character at time (by calling add()), or at once by calling one of the various stem(something) methods.
Stemmer, implementing the Porter Stemming Algorithm
The Stemmer class transforms a word into its root form. The input word can be provided a character at time (by calling add()), or at once by calling one of the various stem(something) methods.
00 Remarks
The Porter stemming algorithm is a process for removing the commoner morphological and inflexional endings from words in English. Its main use is as part of a term normalization process that is usually done when setting up Information Retrieval systems.
History and Development:
How it Works:
Steps in the Algorithm:
Advantages:
Disadvantages:
Applications:
Extensions and Variants:
In summary, the Porter stemming algorithm is a foundational technique in text processing that helps in normalizing words to their base form, thereby enhancing the efficiency and effectiveness of various text-based applications. Despite its limitations, it remains a widely used and influential algorithm in the field of computational linguistics and information retrieval.
01 Syntax
02 Methods
| Name | Overloads | Summary |
|---|---|---|
| add | 2 | Add a character to the word being stemmed. |
| ToString | 1 | After a word has been stemmed, it can be retrieved by toString(), or a reference to the internal buffer can be retrieved by getResultBuffer and getResultLength (which is generall… |
| stem | 1 | Stem the word placed into the Stemmer buffer through calls to add(). |
03 Properties
| Name | Overloads | Summary |
|---|---|---|
| ResultLength | 1 | Returns the length of the word resulting from the stemming process. |
| ResultBuffer | 1 | Returns a reference to a character buffer containing the results of the stemming process. |
04 Members
Char)Add a character to the word being stemmed. When you are finished adding characters, you can call stem(void) to stem the word.
Char(), Int32)Adds wLen characters to the word being stemmed contained in a portion of a char[] array. This is like repeated calls of add(char ch), but faster.
After a word has been stemmed, it can be retrieved by toString(), or a reference to the internal buffer can be retrieved by getResultBuffer and getResultLength (which is generally more efficient.)
Stem the word placed into the Stemmer buffer through calls to add(). Returns true if the stemming process resulted in a word different from the input. You can retrieve the result with getResultLength()/getResultBuffer() or toString().
Returns the length of the word resulting from the stemming process.
Returns a reference to a character buffer containing the results of the stemming process. You also need to consult getResultLength() to determine the length of the result.