class documentation

A stemmer that uses regular expressions to identify morphological affixes. Any substrings that match the regular expressions will be removed.

>>> from nltk.stem import RegexpStemmer
>>> st = RegexpStemmer('ing$|s$|e$|able$', min=4)
>>> st.stem('cars')
'car'
>>> st.stem('mass')
'mas'
>>> st.stem('was')
'was'
>>> st.stem('bee')
'bee'
>>> st.stem('compute')
'comput'
>>> st.stem('advisable')
'advis'
Parameters
regexpThe regular expression that should be used to identify morphological affixes.
minThe minimum length of string to stem
Method __init__ Undocumented
Method __repr__ Undocumented
Method stem Strip affixes from the token and return the stem.
Instance Variable _min Undocumented
Instance Variable _regexp Undocumented
def __init__(self, regexp, min=0): (source)

Undocumented

def __repr__(self): (source)

Undocumented

def stem(self, word): (source)

Strip affixes from the token and return the stem.

Parameters
wordUndocumented
token:strThe token that should be stemmed.

Undocumented

Undocumented