class documentation
class PorterStemmer(_LanguageSpecificStemmer, porter.PorterStemmer): (source)
Constructor: PorterStemmer(ignore_stopwords)
A word stemmer based on the original Porter stemming algorithm.
Porter, M. "An algorithm for suffix stripping." Program 14.3 (1980): 130-137.
A few minor modifications have been made to Porter's basic algorithm. See the source code of the module nltk.stem.porter for more information.
Method | __init__ |
Undocumented |
Inherited from _LanguageSpecificStemmer
:
Method | __repr__ |
Print out the string representation of the respective class. |
Instance Variable | stopwords |
Undocumented |
Inherited from PorterStemmer
(via _LanguageSpecificStemmer
):
Method | stem |
:param to_lowercase: if `to_lowercase=True` the word always lowercase |
Constant | MARTIN |
Undocumented |
Constant | NLTK |
Undocumented |
Constant | ORIGINAL |
Undocumented |
Instance Variable | mode |
Undocumented |
Instance Variable | pool |
Undocumented |
Instance Variable | vowels |
Undocumented |
Method | _apply |
Applies the first applicable suffix-removal rule to the word |
Method | _contains |
Returns True if stem contains a vowel, else False |
Method | _ends |
Implements condition *o from the paper |
Method | _ends |
Implements condition *d from the paper |
Method | _has |
Undocumented |
Method | _is |
Returns True if word[i] is a consonant, False otherwise |
Method | _measure |
Returns the 'measure' of stem, per definition in the paper |
Method | _replace |
Replaces `suffix` of `word` with `replacement |
Method | _step1a |
Implements Step 1a from "An algorithm for suffix stripping" |
Method | _step1b |
Implements Step 1b from "An algorithm for suffix stripping" |
Method | _step1c |
Implements Step 1c from "An algorithm for suffix stripping" |
Method | _step2 |
Implements Step 2 from "An algorithm for suffix stripping" |
Method | _step3 |
Implements Step 3 from "An algorithm for suffix stripping" |
Method | _step4 |
Implements Step 4 from "An algorithm for suffix stripping" |
Method | _step5a |
Implements Step 5a from "An algorithm for suffix stripping" |
Method | _step5b |
Implements Step 5a from "An algorithm for suffix stripping" |