def encode(self, word):
<EOL>word = unicode_normalize('<STR_LIT>', text_type(word.upper()))<EOL>word = word.translate({<NUM_LIT>: '<STR_LIT>', <NUM_LIT>: '<STR_LIT>'})<EOL>word = '<STR_LIT>'.join(c for c in word if c in self._uc_set)<EOL>for rule in self._rule_order:<EOL><INDENT>regex, repl = self._rule_table[rule]<EOL>if isinstance(regex, text_type):<EOL><INDENT>word = word.replace(regex, repl)<EOL><DEDENT>else:<EOL><INDENT>word = regex.sub(repl, word)<EOL><DEDENT><DEDENT>return word<EOL>
Return the FONEM code of a word.

        Parameters
        ----------
        word : str
            The word to transform

        Returns
        -------
        str
            The FONEM code

        Examples
        --------
        >>> pe = FONEM()
        >>> pe.encode('Marchand')
        'MARCHEN'
        >>> pe.encode('Beaulieu')
        'BOLIEU'
        >>> pe.encode('Beaumont')
        'BOMON'
        >>> pe.encode('Legrand')
        'LEGREN'
        >>> pe.encode('Pelletier')
        'PELETIER'