'Stem a German word and return the stemmed form.
:param word: The word that is stemmed.
:type word: str or unicode
:return: The stemmed form.
:rtype: unicode'

def stem(self, word):

    word = word.lower()
    if (word in self.stopwords):
        return word
    word = word.replace(u'\xdf', u'ss')
    for i in range(1, (len(word) - 1)):
        if ((word[(i - 1)] in self.__vowels) and (word[(i + 1)] in self.__vowels)):
            if (word[i] == u'u'):
                word = u''.join((word[:i], u'U', word[(i + 1):]))
            elif (word[i] == u'y'):
                word = u''.join((word[:i], u'Y', word[(i + 1):]))
    (r1, r2) = self._r1r2_standard(word, self.__vowels)
    for i in range(1, len(word)):
        if ((word[i] not in self.__vowels) and (word[(i - 1)] in self.__vowels)):
            if ((len(word[:(i + 1)]) < 3) and (len(word[:(i + 1)]) > 0)):
                r1 = word[3:]
            elif (len(word[:(i + 1)]) == 0):
                return word
            break
    for suffix in self.__step1_suffixes:
        if r1.endswith(suffix):
            if ((suffix in (u'en', u'es', u'e')) and (word[((- len(suffix)) - 4):(- len(suffix))] == u'niss')):
                word = word[:((- len(suffix)) - 1)]
                r1 = r1[:((- len(suffix)) - 1)]
                r2 = r2[:((- len(suffix)) - 1)]
            elif (suffix == u's'):
                if (word[(-2)] in self.__s_ending):
                    word = word[:(-1)]
                    r1 = r1[:(-1)]
                    r2 = r2[:(-1)]
            else:
                word = word[:(- len(suffix))]
                r1 = r1[:(- len(suffix))]
                r2 = r2[:(- len(suffix))]
            break
    for suffix in self.__step2_suffixes:
        if r1.endswith(suffix):
            if (suffix == u'st'):
                if ((word[(-3)] in self.__st_ending) and (len(word[:(-3)]) >= 3)):
                    word = word[:(-2)]
                    r1 = r1[:(-2)]
                    r2 = r2[:(-2)]
            else:
                word = word[:(- len(suffix))]
                r1 = r1[:(- len(suffix))]
                r2 = r2[:(- len(suffix))]
            break
    for suffix in self.__step3_suffixes:
        if r2.endswith(suffix):
            if (suffix in (u'end', u'ung')):
                if ((u'ig' in r2[((- len(suffix)) - 2):(- len(suffix))]) and (u'e' not in r2[((- len(suffix)) - 3):((- len(suffix)) - 2)])):
                    word = word[:((- len(suffix)) - 2)]
                else:
                    word = word[:(- len(suffix))]
            elif ((suffix in (u'ig', u'ik', u'isch')) and (u'e' not in r2[((- len(suffix)) - 1):(- len(suffix))])):
                word = word[:(- len(suffix))]
            elif (suffix in (u'lich', u'heit')):
                if ((u'er' in r1[((- len(suffix)) - 2):(- len(suffix))]) or (u'en' in r1[((- len(suffix)) - 2):(- len(suffix))])):
                    word = word[:((- len(suffix)) - 2)]
                else:
                    word = word[:(- len(suffix))]
            elif (suffix == u'keit'):
                if (u'lich' in r2[((- len(suffix)) - 4):(- len(suffix))]):
                    word = word[:((- len(suffix)) - 4)]
                elif (u'ig' in r2[((- len(suffix)) - 2):(- len(suffix))]):
                    word = word[:((- len(suffix)) - 2)]
                else:
                    word = word[:(- len(suffix))]
            break
    word = word.replace(u'\xe4', u'a').replace(u'\xf6', u'o').replace(u'\xfc', u'u').replace(u'U', u'u').replace(u'Y', u'y')
    return word
