class_docstr: Encoder based on a user-supplied vocabulary (file or list).
docstr: Converts a space-separated string of tokens to a list of ids.
code: def encode(self, s):
      """Converts a space-separated string of tokens to a list of ids."""
      sentence = s
      tokens = sentence.strip().split()
      if self._replace_oov is not None:
          tokens = [
              t if t in self._token_to_id else self._replace_oov
              for t in tokens
          ]
      ret = [self._token_to_id[tok] for tok in tokens]
      return ret[::-1] if self._reverse else ret
  
imports: import re
  import six
label_desc: Use image node_id 2 for calling the TokenTextEncoder obj's underlying member method code with example usage: obj.encode(s) and returns: unknown