Package nltk :: Package stem :: Module snowball2 :: Class PortugueseStemmer
[hide private]
[frames] | no frames]

type PortugueseStemmer

source code

          object --+            
                   |            
        api.StemmerI --+        
                       |        
_LanguageSpecificStemmer --+    
                           |    
            _StandardStemmer --+
                               |
                              PortugueseStemmer

The Portuguese Snowball stemmer.


Note: A detailed description of the Portuguese stemming algorithm can be found under http://snowball.tartarus.org/algorithms /portuguese/stemmer.html.

Instance Methods [hide private]
unicode
stem(self, word)
Stem a Portuguese word and return the stemmed form.
source code

Inherited from _StandardStemmer (private): _r1r2_standard, _rv_standard

Inherited from _LanguageSpecificStemmer: __init__, __repr__

Class Variables [hide private]
unicode __vowels = u'aeiouáéíóúâêô'
The Portuguese vowels.
tuple __step1_suffixes = (u'amentos', u'imentos', u'uciones', u'amen...
Suffixes to be deleted in step 1 of the algorithm.
tuple __step2_suffixes = (u'aríamos', u'eríamos', u'iríamos', u'ásse...
Suffixes to be deleted in step 2 of the algorithm.
tuple __step4_suffixes = (u'os', u'a', u'i', u'o', u'á', u'í', u'ó')
Suffixes to be deleted in step 4 of the algorithm.
Method Details [hide private]

stem(self, word)

source code 

Stem a Portuguese word and return the stemmed form.

Parameters:
  • word (str, unicode) - The word that is stemmed.
Returns: unicode
The stemmed form.
Overrides: api.StemmerI.stem

Class Variable Details [hide private]

__step1_suffixes

Suffixes to be deleted in step 1 of the algorithm.
Type:
tuple
Value:
(u'amentos',
 u'imentos',
 u'uciones',
 u'amento',
 u'imento',
 u'adoras',
 u'adores',
 u'aço~es',
...

__step2_suffixes

Suffixes to be deleted in step 2 of the algorithm.
Type:
tuple
Value:
(u'aríamos',
 u'eríamos',
 u'iríamos',
 u'ássemos',
 u'êssemos',
 u'íssemos',
 u'aríeis',
 u'eríeis',
...