def encode(self, word, max_length=<NUM_LIT:8>):
<EOL>word = '<STR_LIT>'.join(<EOL>char for char in word.lower() if char in self._initial_phones<EOL>)<EOL>if not word:<EOL><INDENT>word = '<STR_LIT>'<EOL><DEDENT>values = [self._initial_phones[word[<NUM_LIT:0>]]]<EOL>values += [self._trailing_phones[char] for char in word[<NUM_LIT:1>:]]<EOL>shifted_values = [_ >> <NUM_LIT:1> for _ in values]<EOL>condensed_values = [values[<NUM_LIT:0>]]<EOL>for n in range(<NUM_LIT:1>, len(shifted_values)):<EOL><INDENT>if shifted_values[n] != shifted_values[n - <NUM_LIT:1>]:<EOL><INDENT>condensed_values.append(values[n])<EOL><DEDENT><DEDENT>values = (<EOL>[condensed_values[<NUM_LIT:0>]]<EOL>+ [<NUM_LIT:0>] * max(<NUM_LIT:0>, max_length - len(condensed_values))<EOL>+ condensed_values[<NUM_LIT:1>:max_length]<EOL>)<EOL>hash_value = <NUM_LIT:0><EOL>for val in values:<EOL><INDENT>hash_value = (hash_value << <NUM_LIT:8>) | val<EOL><DEDENT>return hash_value<EOL>
Return the eudex phonetic hash of a word.

        Parameters
        ----------
        word : str
            The word to transform
        max_length : int
            The length in bits of the code returned (default 8)

        Returns
        -------
        int
            The eudex hash

        Examples
        --------
        >>> pe = Eudex()
        >>> pe.encode('Colin')
        432345564238053650
        >>> pe.encode('Christopher')
        433648490138894409
        >>> pe.encode('Niall')
        648518346341351840
        >>> pe.encode('Smith')
        720575940412906756
        >>> pe.encode('Schmidt')
        720589151732307997