def encode(self, word):
word = word.upper()<EOL>code = '<STR_LIT>'<EOL>skip = <NUM_LIT:0><EOL>if word[<NUM_LIT:0>:<NUM_LIT:2>] == '<STR_LIT>':<EOL><INDENT>code = '<STR_LIT>'<EOL>skip = <NUM_LIT:2><EOL><DEDENT>elif word[<NUM_LIT:0>:<NUM_LIT:2>] == '<STR_LIT>':<EOL><INDENT>code = '<STR_LIT>'<EOL>skip = <NUM_LIT:2><EOL><DEDENT>elif word[<NUM_LIT:0>:<NUM_LIT:3>] == '<STR_LIT>':<EOL><INDENT>code = '<STR_LIT:X>'<EOL>skip = <NUM_LIT:3><EOL><DEDENT>elif word[<NUM_LIT:0>:<NUM_LIT:2>] == '<STR_LIT>':<EOL><INDENT>code = '<STR_LIT>'<EOL>skip = <NUM_LIT:2><EOL><DEDENT>elif word[<NUM_LIT:0>:<NUM_LIT:2>] == '<STR_LIT>':<EOL><INDENT>code = '<STR_LIT:X>'<EOL>skip = <NUM_LIT:2><EOL><DEDENT>elif word[:<NUM_LIT:1>] == '<STR_LIT:C>':<EOL><INDENT>code = '<STR_LIT>'<EOL>skip = <NUM_LIT:1><EOL><DEDENT>elif word[:<NUM_LIT:1>] == '<STR_LIT>':<EOL><INDENT>code = '<STR_LIT>'<EOL>skip = <NUM_LIT:1><EOL><DEDENT>elif word[:<NUM_LIT:1>] == '<STR_LIT>':<EOL><INDENT>code = '<STR_LIT>'<EOL>skip = <NUM_LIT:1><EOL><DEDENT>if word[-<NUM_LIT:2>:] == '<STR_LIT>':<EOL><INDENT>word = word[:-<NUM_LIT:2>] + '<STR_LIT:T>'<EOL><DEDENT>elif word[-<NUM_LIT:2>:-<NUM_LIT:1>] in self._uc_v_set and word[-<NUM_LIT:1>:] == '<STR_LIT:D>':<EOL><INDENT>word = word[:-<NUM_LIT:2>]<EOL><DEDENT>for pos, char in enumerate(word):<EOL><INDENT>if skip:<EOL><INDENT>skip -= <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>for length in sorted(self._replacements, reverse=True):<EOL><INDENT>if word[pos : pos + length] in self._replacements[length]:<EOL><INDENT>code += self._replacements[length][<EOL>word[pos : pos + length]<EOL>]<EOL>skip = length - <NUM_LIT:1><EOL>break<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if not pos or char not in self._uc_v_set:<EOL><INDENT>code += char<EOL><DEDENT><DEDENT><DEDENT><DEDENT>code = self._delete_consecutive_repeats(code)<EOL>return code<EOL>
Return the Norphone code.

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

        Returns
        -------
        str
            The Norphone code

        Examples
        --------
        >>> pe = Norphone()
        >>> pe.encode('Hansen')
        'HNSN'
        >>> pe.encode('Larsen')
        'LRSN'
        >>> pe.encode('Aagaard')
        'ÅKRT'
        >>> pe.encode('Braaten')
        'BRTN'
        >>> pe.encode('Sandvik')
        'SNVK'