'Stem an Hungarian 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
    r1 = self.__r1_hungarian(word, self.__vowels, self.__digraphs)
    if r1.endswith(self.__step1_suffixes):
        for double_cons in self.__double_consonants:
            if (word[((-2) - len(double_cons)):(-2)] == double_cons):
                word = u''.join((word[:(-4)], word[(-3)]))
                if (r1[((-2) - len(double_cons)):(-2)] == double_cons):
                    r1 = u''.join((r1[:(-4)], r1[(-3)]))
                break
    for suffix in self.__step2_suffixes:
        if word.endswith(suffix):
            if r1.endswith(suffix):
                word = word[:(- len(suffix))]
                r1 = r1[:(- len(suffix))]
                if r1.endswith(u'\xe1'):
                    word = u''.join((word[:(-1)], u'a'))
                    r1 = suffix_replace(r1, u'\xe1', u'a')
                elif r1.endswith(u'\xe9'):
                    word = u''.join((word[:(-1)], u'e'))
                    r1 = suffix_replace(r1, u'\xe9', u'e')
            break
    for suffix in self.__step3_suffixes:
        if r1.endswith(suffix):
            if (suffix == u'\xe9n'):
                word = suffix_replace(word, suffix, u'e')
                r1 = suffix_replace(r1, suffix, u'e')
            else:
                word = suffix_replace(word, suffix, u'a')
                r1 = suffix_replace(r1, suffix, u'a')
            break
    for suffix in self.__step4_suffixes:
        if r1.endswith(suffix):
            if (suffix == u'\xe1stul'):
                word = suffix_replace(word, suffix, u'a')
                r1 = suffix_replace(r1, suffix, u'a')
            elif (suffix == u'\xe9st\xfcl'):
                word = suffix_replace(word, suffix, u'e')
                r1 = suffix_replace(r1, suffix, u'e')
            else:
                word = word[:(- len(suffix))]
                r1 = r1[:(- len(suffix))]
            break
    for suffix in self.__step5_suffixes:
        if r1.endswith(suffix):
            for double_cons in self.__double_consonants:
                if (word[((-1) - len(double_cons)):(-1)] == double_cons):
                    word = u''.join((word[:(-3)], word[(-2)]))
                    if (r1[((-1) - len(double_cons)):(-1)] == double_cons):
                        r1 = u''.join((r1[:(-3)], r1[(-2)]))
                    break
    for suffix in self.__step6_suffixes:
        if r1.endswith(suffix):
            if (suffix in (u'\xe1k\xe9', u'\xe1\xe9i')):
                word = suffix_replace(word, suffix, u'a')
                r1 = suffix_replace(r1, suffix, u'a')
            elif (suffix in (u'\xe9k\xe9', u'\xe9\xe9i', u'\xe9\xe9')):
                word = suffix_replace(word, suffix, u'e')
                r1 = suffix_replace(r1, suffix, u'e')
            else:
                word = word[:(- len(suffix))]
                r1 = r1[:(- len(suffix))]
            break
    for suffix in self.__step7_suffixes:
        if word.endswith(suffix):
            if r1.endswith(suffix):
                if (suffix in (u'\xe1nk', u'\xe1juk', u'\xe1m', u'\xe1d', u'\xe1')):
                    word = suffix_replace(word, suffix, u'a')
                    r1 = suffix_replace(r1, suffix, u'a')
                elif (suffix in (u'\xe9nk', u'\xe9j\xfck', u'\xe9m', u'\xe9d', u'\xe9')):
                    word = suffix_replace(word, suffix, u'e')
                    r1 = suffix_replace(r1, suffix, u'e')
                else:
                    word = word[:(- len(suffix))]
                    r1 = r1[:(- len(suffix))]
            break
    for suffix in self.__step8_suffixes:
        if word.endswith(suffix):
            if r1.endswith(suffix):
                if (suffix in (u'\xe1im', u'\xe1id', u'\xe1i', u'\xe1ink', u'\xe1itok', u'\xe1ik')):
                    word = suffix_replace(word, suffix, u'a')
                    r1 = suffix_replace(r1, suffix, u'a')
                elif (suffix in (u'\xe9im', u'\xe9id', u'\xe9i', u'\xe9ink', u'\xe9itek', u'\xe9ik')):
                    word = suffix_replace(word, suffix, u'e')
                    r1 = suffix_replace(r1, suffix, u'e')
                else:
                    word = word[:(- len(suffix))]
                    r1 = r1[:(- len(suffix))]
            break
    for suffix in self.__step9_suffixes:
        if word.endswith(suffix):
            if r1.endswith(suffix):
                if (suffix == u'\xe1k'):
                    word = suffix_replace(word, suffix, u'a')
                elif (suffix == u'\xe9k'):
                    word = suffix_replace(word, suffix, u'e')
                else:
                    word = word[:(- len(suffix))]
            break
    return word
