Package nltk :: Package stem :: Module lancaster :: Class LancasterStemmer
[hide private]
[frames] | no frames]

Class LancasterStemmer

source code

  object --+    
           |    
api.StemmerI --+
               |
              LancasterStemmer
Known Subclasses:

Instance Methods [hide private]
 
__init__(self)
Create an instance of the Lancaster stemmer.
source code
 
parseRules(self, rule_tuple)
Validate the set of rules used in this stemmer.
source code
 
stem(self, word)
Stem a word using the Lancaster stemmer.
source code
 
__doStemming(self, word, intact_word)
Perform the actual word stemming
source code
 
__getLastLetter(self, word)
Get the zero-based index of the last alphabetic character in this string
source code
 
__isAcceptable(self, word, remove_total)
Determine if the word is acceptable for stemming.
source code
 
__applyRule(self, word, remove_total, append_string)
Apply the stemming rule to the word
source code
 
__repr__(self)
repr(x)
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__

Class Variables [hide private]
  rule_tuple = ('ai*2.', 'a*1.', 'bb1.', 'city3s.', 'ci2>', 'cn1...
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

Create an instance of the Lancaster stemmer.

Overrides: object.__init__

stem(self, word)

source code 

Stem a word using the Lancaster stemmer.

Parameters:
  • token - The token that should be stemmed.
Overrides: api.StemmerI.stem

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

Class Variable Details [hide private]

rule_tuple

Value:
('ai*2.',
 'a*1.',
 'bb1.',
 'city3s.',
 'ci2>',
 'cn1t>',
 'dd1.',
 'dei3y>',
...