def _expand_alternates(self, phonetic):
alt_start = phonetic.find('<STR_LIT:(>')<EOL>if alt_start == -<NUM_LIT:1>:<EOL><INDENT>return self._normalize_lang_attrs(phonetic, False)<EOL><DEDENT>prefix = phonetic[:alt_start]<EOL>alt_start += <NUM_LIT:1>  <EOL>alt_end = phonetic.find('<STR_LIT:)>', alt_start)<EOL>alt_string = phonetic[alt_start:alt_end]<EOL>alt_end += <NUM_LIT:1>  <EOL>suffix = phonetic[alt_end:]<EOL>alt_array = alt_string.split('<STR_LIT:|>')<EOL>result = '<STR_LIT>'<EOL>for i in range(len(alt_array)):<EOL><INDENT>alt = alt_array[i]<EOL>alternate = self._expand_alternates(prefix + alt + suffix)<EOL>if alternate != '<STR_LIT>' and alternate != '<STR_LIT>':<EOL><INDENT>if result != '<STR_LIT>':<EOL><INDENT>result += '<STR_LIT:|>'<EOL><DEDENT>result += alternate<EOL><DEDENT><DEDENT>return result<EOL>
Expand phonetic alternates separated by |s.

        Parameters
        ----------
        phonetic : str
            A Beider-Morse phonetic encoding

        Returns
        -------
        str
            A Beider-Morse phonetic code