class nltk.LancasterStemmer[source]

Lancaster Stemmer

>>> from import LancasterStemmer
>>> st = LancasterStemmer()
>>> st.stem('maximum')     # Remove "-um" when word is intact
>>> st.stem('presumably')  # Don't remove "-um" when word is not intact
>>> st.stem('multiply')    # No action taken if word ends with "-ply"
>>> st.stem('provision')   # Replace "-sion" with "-j" to trigger "j" set of rules
>>> st.stem('owed')        # Word starting with vowel must contain at least 2 letters
>>> st.stem('ear')         # ditto
>>> st.stem('saying')      # Words starting with consonant must contain at least 3
>>> st.stem('crying')      #     letters and one of those letters must be a vowel
>>> st.stem('string')      # ditto
>>> st.stem('meant')       # ditto
>>> st.stem('cement')      # ditto


__init__() Create an instance of the Lancaster stemmer.
parseRules(rule_tuple) Validate the set of rules used in this stemmer.
stem(word) Stem a word using the Lancaster stemmer.