Package nltk :: Package stem :: Module snowball :: Class _ScandinavianStemmer
[hide private]
[frames] | no frames]

type _ScandinavianStemmer

source code

          object --+        
                   |        
        api.StemmerI --+    
                       |    
_LanguageSpecificStemmer --+
                           |
                          _ScandinavianStemmer
Known Subclasses:

This subclass encapsulates a method for defining the string region R1. It is used by the Danish, Norwegian, and Swedish stemmer.

Instance Methods [hide private]
unicode
_r1_scandinavian(self, word, vowels)
Return the region R1 that is used by the Scandinavian stemmers.
source code

Inherited from _LanguageSpecificStemmer: __init__, __repr__

Inherited from api.StemmerI: stem

Method Details [hide private]

_r1_scandinavian(self, word, vowels)

source code 

Return the region R1 that is used by the Scandinavian stemmers.

R1 is the region after the first non-vowel following a vowel, or is the null region at the end of the word if there is no such non-vowel. But then R1 is adjusted so that the region before it contains at least three letters.

Parameters:
  • word (str, unicode) - The word whose region R1 is determined.
  • vowels (unicode) - The vowels of the respective language that are used to determine the region R1.
Returns: unicode
r1, the region R1 for the respective word.

Note: This helper method is invoked by the respective stem method of the subclasses DanishStemmer, NorwegianStemmer, and SwedishStemmer. It is not to be invoked directly!