(self, word)
return word
Stem a Danish 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 Danish word and return the stemmed form.
Stem a Danish word and return the stemmed form .
def stem(self, word):
        """
        Stem a Danish word and return the stemmed form.

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

        """
        # Every word is put into lower case for normalization.
        word = word.lower()

        # After this, the required regions are generated
        # by the respective helper method.
        r1 = self._r1_scandinavian(word, self.__vowels)

        # Then the actual stemming process starts.
        # Every new step is explicitly indicated
        # according to the descriptions on the Snowball website.

        # STEP 1
        for suffix in self.__step1_suffixes:
            if r1.endswith(suffix):
                if suffix == "s":
                    if word[-2] in self.__s_ending:
                        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
        if r1.endswith("igst"):
            word = word[:-2]
            r1 = r1[:-2]

        for suffix in self.__step3_suffixes:
            if r1.endswith(suffix):
                if suffix == u("l\xF8st"):
                    word = word[:-1]
                    r1 = r1[:-1]
                else:
                    word = word[:-len(suffix)]
                    r1 = r1[:-len(suffix)]

                    if r1.endswith(self.__step2_suffixes):
                        word = word[:-1]
                        r1 = r1[:-1]
                break

        # STEP 4: Undouble
        for double_cons in self.__double_consonants:
            if word.endswith(double_cons) and len(word) > 3:
                word = word[:-1]
                break

        return word
def stem ( self , word ) : # Every word is put into lower case for normalization. word = word . lower ( ) # After this, the required regions are generated # by the respective helper method. r1 = self . _r1_scandinavian ( word , self . __vowels ) # Then the actual stemming process starts. # Every new step is explicitly indicated # according to the descriptions on the Snowball website. # STEP 1 for suffix in self . __step1_suffixes : if r1 . endswith ( suffix ) : if suffix == "s" : if word [ - 2 ] in self . __s_ending : 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 if r1 . endswith ( "igst" ) : word = word [ : - 2 ] r1 = r1 [ : - 2 ] for suffix in self . __step3_suffixes : if r1 . endswith ( suffix ) : if suffix == u ( "l\xF8st" ) : word = word [ : - 1 ] r1 = r1 [ : - 1 ] else : word = word [ : - len ( suffix ) ] r1 = r1 [ : - len ( suffix ) ] if r1 . endswith ( self . __step2_suffixes ) : word = word [ : - 1 ] r1 = r1 [ : - 1 ] break # STEP 4: Undouble for double_cons in self . __double_consonants : if word . endswith ( double_cons ) and len ( word ) > 3 : word = word [ : - 1 ] break return word