parameters: (transcript, alphabet, context='')
return_statement: return encoded
docstring: r"""
      Given a transcript string, map characters to
      integers and return a numpy array representing the processed string.
      Use a string in `context` for adding text to raised exceptions.
docstring_summary: r"""
      Given a transcript string, map characters to
      integers and return a numpy array representing the processed string.
      Use a string in `context` for adding text to raised exceptions.
docstring_tokens: r Given a transcript string map characters to integers and return a numpy array representing the processed string . Use a string in context for adding text to raised exceptions .
function: def text_to_char_array(transcript, alphabet, context=''):
      r"""
      Given a transcript string, map characters to
      integers and return a numpy array representing the processed string.
      Use a string in `context` for adding text to raised exceptions.
      """
      if not alphabet.CanEncode(transcript):
          # Provide the row context (especially wav_filename) for alphabet errors
          raise ValueError(
              'Alphabet cannot encode transcript "{}" while processing sample "{}", '
              'check that your alphabet contains all characters in the training corpus. '
              'Missing characters are: {}.'
              .format(transcript, context, list(ch for ch in transcript if not alphabet.CanEncodeSingle(ch))))
  
      encoded = alphabet.Encode(transcript)
      if len(encoded) == 0:
          raise ValueError('While processing {}: Found an empty transcript! '
                           'You must include a transcript for all training data.'
                           .format(context))
      return encoded
function_tokens: def text_to_char_array ( transcript , alphabet , context = '' ) : if not alphabet . CanEncode ( transcript ) : # Provide the row context (especially wav_filename) for alphabet errors raise ValueError ( 'Alphabet cannot encode transcript "{}" while processing sample "{}", ' 'check that your alphabet contains all characters in the training corpus. ' 'Missing characters are: {}.' . format ( transcript , context , list ( ch for ch in transcript if not alphabet . CanEncodeSingle ( ch ) ) ) ) encoded = alphabet . Encode ( transcript ) if len ( encoded ) == 0 : raise ValueError ( 'While processing {}: Found an empty transcript! ' 'You must include a transcript for all training data.' . format ( context ) ) return encoded