def encode(<EOL>self,<EOL>word,<EOL>language_arg=<NUM_LIT:0>,<EOL>name_mode='<STR_LIT>',<EOL>match_mode='<STR_LIT>',<EOL>concat=False,<EOL>filter_langs=False,<EOL>):
word = normalize('<STR_LIT>', text_type(word.strip().lower()))<EOL>name_mode = name_mode.strip().lower()[:<NUM_LIT:3>]<EOL>if name_mode not in {'<STR_LIT>', '<STR_LIT>', '<STR_LIT>'}:<EOL><INDENT>name_mode = '<STR_LIT>'<EOL><DEDENT>if match_mode != '<STR_LIT>':<EOL><INDENT>match_mode = '<STR_LIT>'<EOL><DEDENT>all_langs = (<EOL>sum(_LANG_DICT[_] for _ in BMDATA[name_mode]['<STR_LIT>']) - <NUM_LIT:1><EOL>)<EOL>lang_choices = <NUM_LIT:0><EOL>if isinstance(language_arg, (int, float, long)):<EOL><INDENT>lang_choices = int(language_arg)<EOL><DEDENT>elif language_arg != '<STR_LIT>' and isinstance(language_arg, (text_type, str)):<EOL><INDENT>for lang in text_type(language_arg).lower().split('<STR_LIT:U+002C>'):<EOL><INDENT>if lang in _LANG_DICT and (_LANG_DICT[lang] & all_langs):<EOL><INDENT>lang_choices += _LANG_DICT[lang]<EOL><DEDENT>elif not filter_langs:<EOL><INDENT>raise ValueError(<EOL>'<STR_LIT>'<EOL>+ name_mode<EOL>+ '<STR_LIT>'<EOL>+ lang<EOL>+ '<STR_LIT>'<EOL>)<EOL><DEDENT><DEDENT><DEDENT>if lang_choices == <NUM_LIT:0>:<EOL><INDENT>language_arg = self._language(word, name_mode)<EOL><DEDENT>else:<EOL><INDENT>language_arg = lang_choices<EOL><DEDENT>language_arg2 = self._language_index_from_code(language_arg, name_mode)<EOL>rules = BMDATA[name_mode]['<STR_LIT>'][language_arg2]<EOL>final_rules1 = BMDATA[name_mode][match_mode]['<STR_LIT>']<EOL>final_rules2 = BMDATA[name_mode][match_mode][language_arg2]<EOL>result = self._phonetic(<EOL>word,<EOL>name_mode,<EOL>rules,<EOL>final_rules1,<EOL>final_rules2,<EOL>language_arg,<EOL>concat,<EOL>)<EOL>result = self._phonetic_numbers(result)<EOL>return result<EOL>
Return the Beider-Morse Phonetic Matching encoding(s) of a term.

        Parameters
        ----------
        word : str
            The word to transform
        language_arg : int
            The language of the term; supported values include:

                - ``any``
                - ``arabic``
                - ``cyrillic``
                - ``czech``
                - ``dutch``
                - ``english``
                - ``french``
                - ``german``
                - ``greek``
                - ``greeklatin``
                - ``hebrew``
                - ``hungarian``
                - ``italian``
                - ``latvian``
                - ``polish``
                - ``portuguese``
                - ``romanian``
                - ``russian``
                - ``spanish``
                - ``turkish``

        name_mode : str
            The name mode of the algorithm:

                - ``gen`` -- general (default)
                - ``ash`` -- Ashkenazi
                - ``sep`` -- Sephardic

        match_mode : str
            Matching mode: ``approx`` or ``exact``
        concat : bool
            Concatenation mode
        filter_langs : bool
            Filter out incompatible languages

        Returns
        -------
        tuple
            The Beider-Morse phonetic value(s)

        Raises
        ------
        ValueError
            Unknown language

        Examples
        --------
        >>> pe = BeiderMorse()
        >>> pe.encode('Christopher')
        'xrQstopir xrQstYpir xristopir xristYpir xrQstofir xrQstYfir
        xristofir xristYfir xristopi xritopir xritopi xristofi xritofir
        xritofi tzristopir tzristofir zristopir zristopi zritopir zritopi
        zristofir zristofi zritofir zritofi'
        >>> pe.encode('Niall')
        'nial niol'
        >>> pe.encode('Smith')
        'zmit'
        >>> pe.encode('Schmidt')
        'zmit stzmit'

        >>> pe.encode('Christopher', language_arg='German')
        'xrQstopir xrQstYpir xristopir xristYpir xrQstofir xrQstYfir
        xristofir xristYfir'
        >>> pe.encode('Christopher', language_arg='English')
        'tzristofir tzrQstofir tzristafir tzrQstafir xristofir xrQstofir
        xristafir xrQstafir'
        >>> pe.encode('Christopher', language_arg='German', name_mode='ash')
        'xrQstopir xrQstYpir xristopir xristYpir xrQstofir xrQstYfir
        xristofir xristYfir'

        >>> pe.encode('Christopher', language_arg='German', match_mode='exact')
        'xriStopher xriStofer xristopher xristofer'