class_docstr: CharacterIndexUnit for DIIN model.
  
  The input of :class:'CharacterIndexUnit' should be a list of word
  character list extracted from a text. The output is the character
  index representation of this text.
  
  :class:`NgramLetterUnit` and :class:`VocabularyUnit` are two
  essential prerequisite of :class:`CharacterIndexUnit`.
  
  Examples:
      >>> input_ = [['#', 'a', '#'],['#', 'o', 'n', 'e', '#']]
      >>> character_index = CharacterIndex(
      ...     char_index={
      ...      '<PAD>': 0, '<OOV>': 1, 'a': 2, 'n': 3, 'e':4, '#':5},
      ...     fixed_length_text=2,
      ...     fixed_length_word=5)
      >>> index = character_index.transform(input_)
      >>> index
      [[5.0, 2.0, 5.0, 0.0, 0.0], [5.0, 1.0, 3.0, 4.0, 5.0]]
class_docstr_tok: ["CharacterIndexUnit","for","DIIN","model",".","The","input","of",":","class",":","'CharacterIndexUnit","'","should","be","a","list","of","word","character","list","extracted","from","a","text",".","The","output","is","the","character","index","representation","of","this","text",".",":","class",":","`","NgramLetterUnit","`","and",":","class",":","`","VocabularyUnit","`","are","two","essential","prerequisite","of",":","class",":","`","CharacterIndexUnit","`",".","Examples",":",">",">",">","input_","=","[","[","'","#","'",",","'","a","'",",","'","#","'","]",",","[","'","#","'",",","'","o","'",",","'n","'",",","'","e","'",",","'","#","'","]","]",">",">",">","character_index","=","CharacterIndex","(","...","char_index=","{","...","'","<","PAD",">","'",":","0",",","'","<","OOV",">","'",":","1",",","'","a","'",":","2",",","'n","'",":","3",",","'","e':4",",","'","#","':5","}",",","...","fixed_length_text=2",",","...","fixed_length_word=5",")",">",">",">","index","=","character_index.transform","(","input_",")",">",">",">","index","[","[","5.0",",","2.0",",","5.0",",","0.0",",","0.0","]",",","[","5.0",",","1.0",",","3.0",",","4.0",",","5.0","]","]"]
docstr: Transform list of characters to corresponding indices.
  
  :param input_: list of characters generated by
      :class:'NgramLetterUnit'.
  
  :return: character index representation of a text.
docstr_tok: ["Transform","list","of","characters","to","corresponding","indices",".",":","param","input_",":","list","of","characters","generated","by",":","class",":","'NgramLetterUnit","'",".",":","return",":","character","index","representation","of","a","text","."]
code: def transform(self, input_: list) -> list:
      """
      Transform list of characters to corresponding indices.
  
      :param input_: list of characters generated by
          :class:'NgramLetterUnit'.
  
      :return: character index representation of a text.
      """
      idx = np.zeros((self._fixed_length_text, self._fixed_length_word))
      for i in range(min(len(input_), self._fixed_length_text)):
          for j in range(min(len(input_[i]), self._fixed_length_word)):
              idx[i, j] = self._char_index.get(input_[i][j], 1)
  
      return idx.tolist()
  
imports: import numpy
  from .unit import Unit
label_desc: Use image node_id 2 for calling the CharacterIndex obj's underlying member method code with example usage: obj.transform(input_) and returns: idx