'Stem a French 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
    step1_success = False
    rv_ending_found = False
    step2a_success = False
    step2b_success = False
    for i in range(1, len(word)):
        if ((word[(i - 1)] == u'q') and (word[i] == u'u')):
            word = u''.join((word[:i], u'U', word[(i + 1):]))
    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'i'):
                word = u''.join((word[:i], u'I', word[(i + 1):]))
        if ((word[(i - 1)] in self.__vowels) or (word[(i + 1)] in self.__vowels)):
            if (word[i] == u'y'):
                word = u''.join((word[:i], u'Y', word[(i + 1):]))
    (r1, r2) = self._r1r2_standard(word, self.__vowels)
    rv = self.__rv_french(word, self.__vowels)
    for suffix in self.__step1_suffixes:
        if word.endswith(suffix):
            if (suffix == u'eaux'):
                word = word[:(-1)]
                step1_success = True
            elif (suffix in (u'euse', u'euses')):
                if (suffix in r2):
                    word = word[:(- len(suffix))]
                    step1_success = True
                elif (suffix in r1):
                    word = suffix_replace(word, suffix, u'eux')
                    step1_success = True
            elif ((suffix in (u'ement', u'ements')) and (suffix in rv)):
                word = word[:(- len(suffix))]
                step1_success = True
                if ((word[(-2):] == u'iv') and (u'iv' in r2)):
                    word = word[:(-2)]
                    if ((word[(-2):] == u'at') and (u'at' in r2)):
                        word = word[:(-2)]
                elif (word[(-3):] == u'eus'):
                    if (u'eus' in r2):
                        word = word[:(-3)]
                    elif (u'eus' in r1):
                        word = u''.join((word[:(-1)], u'x'))
                elif (word[(-3):] in (u'abl', u'iqU')):
                    if ((u'abl' in r2) or (u'iqU' in r2)):
                        word = word[:(-3)]
                elif (word[(-3):] in (u'i\xe8r', u'I\xe8r')):
                    if ((u'i\xe8r' in rv) or (u'I\xe8r' in rv)):
                        word = u''.join((word[:(-3)], u'i'))
            elif ((suffix == u'amment') and (suffix in rv)):
                word = suffix_replace(word, u'amment', u'ant')
                rv = suffix_replace(rv, u'amment', u'ant')
                rv_ending_found = True
            elif ((suffix == u'emment') and (suffix in rv)):
                word = suffix_replace(word, u'emment', u'ent')
                rv_ending_found = True
            elif ((suffix in (u'ment', u'ments')) and (suffix in rv) and (not rv.startswith(suffix)) and (rv[(rv.rindex(suffix) - 1)] in self.__vowels)):
                word = word[:(- len(suffix))]
                rv = rv[:(- len(suffix))]
                rv_ending_found = True
            elif ((suffix == u'aux') and (suffix in r1)):
                word = u''.join((word[:(-2)], u'l'))
                step1_success = True
            elif ((suffix in (u'issement', u'issements')) and (suffix in r1) and (word[((- len(suffix)) - 1)] not in self.__vowels)):
                word = word[:(- len(suffix))]
                step1_success = True
            elif ((suffix in (u'ance', u'iqUe', u'isme', u'able', u'iste', u'eux', u'ances', u'iqUes', u'ismes', u'ables', u'istes')) and (suffix in r2)):
                word = word[:(- len(suffix))]
                step1_success = True
            elif ((suffix in (u'atrice', u'ateur', u'ation', u'atrices', u'ateurs', u'ations')) and (suffix in r2)):
                word = word[:(- len(suffix))]
                step1_success = True
                if (word[(-2):] == u'ic'):
                    if (u'ic' in r2):
                        word = word[:(-2)]
                    else:
                        word = u''.join((word[:(-2)], u'iqU'))
            elif ((suffix in (u'logie', u'logies')) and (suffix in r2)):
                word = suffix_replace(word, suffix, u'log')
                step1_success = True
            elif ((suffix in (u'usion', u'ution', u'usions', u'utions')) and (suffix in r2)):
                word = suffix_replace(word, suffix, u'u')
                step1_success = True
            elif ((suffix in (u'ence', u'ences')) and (suffix in r2)):
                word = suffix_replace(word, suffix, u'ent')
                step1_success = True
            elif ((suffix in (u'it\xe9', u'it\xe9s')) and (suffix in r2)):
                word = word[:(- len(suffix))]
                step1_success = True
                if (word[(-4):] == u'abil'):
                    if (u'abil' in r2):
                        word = word[:(-4)]
                    else:
                        word = u''.join((word[:(-2)], u'l'))
                elif (word[(-2):] == u'ic'):
                    if (u'ic' in r2):
                        word = word[:(-2)]
                    else:
                        word = u''.join((word[:(-2)], u'iqU'))
                elif (word[(-2):] == u'iv'):
                    if (u'iv' in r2):
                        word = word[:(-2)]
            elif ((suffix in (u'if', u'ive', u'ifs', u'ives')) and (suffix in r2)):
                word = word[:(- len(suffix))]
                step1_success = True
                if ((word[(-2):] == u'at') and (u'at' in r2)):
                    word = word[:(-2)]
                    if (word[(-2):] == u'ic'):
                        if (u'ic' in r2):
                            word = word[:(-2)]
                        else:
                            word = u''.join((word[:(-2)], u'iqU'))
            break
    if ((not step1_success) or rv_ending_found):
        for suffix in self.__step2a_suffixes:
            if word.endswith(suffix):
                if ((suffix in rv) and (len(rv) > len(suffix)) and (rv[(rv.rindex(suffix) - 1)] not in self.__vowels)):
                    word = word[:(- len(suffix))]
                    step2a_success = True
                break
        if (not step2a_success):
            for suffix in self.__step2b_suffixes:
                if rv.endswith(suffix):
                    if ((suffix == u'ions') and (u'ions' in r2)):
                        word = word[:(-4)]
                        step2b_success = True
                    elif (suffix in (u'eraIent', u'erions', u'\xe8rent', u'erais', u'erait', u'eriez', u'erons', u'eront', u'erai', u'eras', u'erez', u'\xe9es', u'era', u'iez', u'\xe9e', u'\xe9s', u'er', u'ez', u'\xe9')):
                        word = word[:(- len(suffix))]
                        step2b_success = True
                    elif (suffix in (u'assions', u'assent', u'assiez', u'aIent', u'antes', u'asses', u'\xe2mes', u'\xe2tes', u'ante', u'ants', u'asse', u'ais', u'ait', u'ant', u'\xe2t', u'ai', u'as', u'a')):
                        word = word[:(- len(suffix))]
                        rv = rv[:(- len(suffix))]
                        step2b_success = True
                        if rv.endswith(u'e'):
                            word = word[:(-1)]
                    break
    if (step1_success or step2a_success or step2b_success):
        if (word[(-1)] == u'Y'):
            word = u''.join((word[:(-1)], u'i'))
        elif (word[(-1)] == u'\xe7'):
            word = u''.join((word[:(-1)], u'c'))
    else:
        if ((len(word) >= 2) and (word[(-1)] == u's') and (word[(-2)] not in u'aiou\xe8s')):
            word = word[:(-1)]
        for suffix in self.__step4_suffixes:
            if word.endswith(suffix):
                if (suffix in rv):
                    if ((suffix == u'ion') and (suffix in r2) and (rv[(-4)] in u'st')):
                        word = word[:(-3)]
                    elif (suffix in (u'ier', u'i\xe8re', u'Ier', u'I\xe8re')):
                        word = suffix_replace(word, suffix, u'i')
                    elif (suffix == u'e'):
                        word = word[:(-1)]
                    elif ((suffix == u'\xeb') and (word[(-3):(-1)] == u'gu')):
                        word = word[:(-1)]
                    break
    if word.endswith((u'enn', u'onn', u'ett', u'ell', u'eill')):
        word = word[:(-1)]
    for i in range(1, len(word)):
        if (word[(- i)] not in self.__vowels):
            i += 1
        else:
            if ((i != 1) and (word[(- i)] in (u'\xe9', u'\xe8'))):
                word = u''.join((word[:(- i)], u'e', word[((- i) + 1):]))
            break
    word = word.replace(u'I', u'i').replace(u'U', u'u').replace(u'Y', u'y')
    return word
