def text_to_sequence(text, cleaner_names, tp=None):
    'Converts a string of text to a sequence of IDs corresponding to the symbols in the text.\n\n      The text can optionally have ARPAbet sequences enclosed in curly braces embedded\n      in it. For example, "Turn left on {HH AW1 S S T AH0 N} Street."\n\n      Args:\n        text: string to convert to a sequence\n        cleaner_names: names of the cleaner functions to run the text through\n\n      Returns:\n        List of integers corresponding to the symbols in the text\n    '
    global _symbol_to_id
    if tp:
        (_symbols, _) = make_symbols(**tp)
        _symbol_to_id = {s: i for (i, s) in enumerate(_symbols)}
    sequence = []
    while text:
        m = _CURLY_RE.match(text)
        if (not m):
            sequence += _symbols_to_sequence(_clean_text(text, cleaner_names))
            break
        sequence += _symbols_to_sequence(_clean_text(m.group(1), cleaner_names))
        sequence += _arpabet_to_sequence(m.group(2))
        text = m.group(3)
    return sequence
Converts a string of text to a sequence of IDs corresponding to the symbols in the text.

The text can optionally have ARPAbet sequences enclosed in curly braces embedded
in it. For example, "Turn left on {HH AW1 S S T AH0 N} Street."

Args:
  text: string to convert to a sequence
  cleaner_names: names of the cleaner functions to run the text through

Returns:
  List of integers corresponding to the symbols in the text
def text_to_sequence(text, cleaner_names, tp=None):
    'Converts a string of text to a sequence of IDs corresponding to the symbols in the text.\n\n      The text can optionally have ARPAbet sequences enclosed in curly braces embedded\n      in it. For example, "Turn left on {HH AW1 S S T AH0 N} Street."\n\n      Args:\n        text: string to convert to a sequence\n        cleaner_names: names of the cleaner functions to run the text through\n\n      Returns:\n        List of integers corresponding to the symbols in the text\n    '
    global _symbol_to_id
    if tp:
        (_symbols, _) = make_symbols(**tp)
        _symbol_to_id = {s: i for (i, s) in enumerate(_symbols)}
    sequence = []
    while text:
        m = _CURLY_RE.match(text)
        if (not m):
            sequence += _symbols_to_sequence(_clean_text(text, cleaner_names))
            break
        sequence += _symbols_to_sequence(_clean_text(m.group(1), cleaner_names))
        sequence += _arpabet_to_sequence(m.group(2))
        text = m.group(3)
    return sequence