class_docstr: Functor for parsing raw strings into list of int tokens.
  
  Examples:
      >>> parser = CharParser(['a', 'b', 'c'])
      >>> parser('abc')
      [0, 1, 2]
class_docstr_tok: ["Functor","for","parsing","raw","strings","into","list","of","int","tokens",".","Examples",":",">",">",">","parser","=","CharParser","(","[","'","a","'",",","'","b","'",",","'","c","'","]",")",">",">",">","parser","(","'abc","'",")","[","0",",","1",",","2","]"]
code: def decode(self, str_input):
      r_map = {}
      for k, v in self._labels_map.items():
          r_map[v] = k
      r_map[len(self._labels_map)] = "<BOS>"
      r_map[len(self._labels_map) + 1] = "<EOS>"
      r_map[len(self._labels_map) + 2] = "<P>"
  
      out = []
      for i in str_input:
          # Skip OOV
          if i not in r_map:
              continue
          out.append(r_map[i.item()])
  
      return "".join(out)
  
file_path: NeMo/nemo/collections/common/parts/preprocessing/parsers.py
imports: import string
  from typing import List, Optional
  from nemo.collections.common.parts.preprocessing import cleaners
label_desc: Use image node_id 5 for calling the CharParser obj's underlying member method code with example usage: obj.decode(str_input) and returns: str