(self, word)
return word
Stem a Norwegian word and return the stemmed form.

        :param word: The word that is stemmed.
        :type word: str or unicode
        :return: The stemmed form.
        :rtype: unicode
Stem a Norwegian word and return the stemmed form.
Stem a Norwegian word and return the stemmed form .
def stem(self, word):
        """
        Stem a Norwegian word and return the stemmed form.

        :param word: The word that is stemmed.
        :type word: str or unicode
        :return: The stemmed form.
        :rtype: unicode

        """
        word = word.lower()

        r1 = self._r1_scandinavian(word, self.__vowels)

        # STEP 1
        for suffix in self.__step1_suffixes:
            if r1.endswith(suffix):
                if suffix in ("erte", "ert"):
                    word = "".join((word[:-len(suffix)], "er"))
                    r1 = "".join((r1[:-len(suffix)], "er"))

                elif suffix == "s":
                    if (word[-2] in self.__s_ending or
                        (word[-2] == "k" and word[-3] not in self.__vowels)):
                        word = word[:-1]
                        r1 = r1[:-1]
                else:
                    word = word[:-len(suffix)]
                    r1 = r1[:-len(suffix)]
                break

        # STEP 2
        for suffix in self.__step2_suffixes:
            if r1.endswith(suffix):
                word = word[:-1]
                r1 = r1[:-1]
                break

        # STEP 3
        for suffix in self.__step3_suffixes:
            if r1.endswith(suffix):
                word = word[:-len(suffix)]
                break

        return word
def stem ( self , word ) : word = word . lower ( ) r1 = self . _r1_scandinavian ( word , self . __vowels ) # STEP 1 for suffix in self . __step1_suffixes : if r1 . endswith ( suffix ) : if suffix in ( "erte" , "ert" ) : word = "" . join ( ( word [ : - len ( suffix ) ] , "er" ) ) r1 = "" . join ( ( r1 [ : - len ( suffix ) ] , "er" ) ) elif suffix == "s" : if ( word [ - 2 ] in self . __s_ending or ( word [ - 2 ] == "k" and word [ - 3 ] not in self . __vowels ) ) : word = word [ : - 1 ] r1 = r1 [ : - 1 ] else : word = word [ : - len ( suffix ) ] r1 = r1 [ : - len ( suffix ) ] break # STEP 2 for suffix in self . __step2_suffixes : if r1 . endswith ( suffix ) : word = word [ : - 1 ] r1 = r1 [ : - 1 ] break # STEP 3 for suffix in self . __step3_suffixes : if r1 . endswith ( suffix ) : word = word [ : - len ( suffix ) ] break return word