class_docstr: Basic tokenizer that tokenizes the input via white spaces.
class_docstr_tok: ["Basic","tokenizer","that","tokenizes","the","input","via","white","spaces","."]
code: def encode(self, sentences, output_type=str):
      is_multiple_sentences = isinstance(sentences, list)
      if not is_multiple_sentences:
          sentences = [sentences]
      if output_type is str:
          tokens = [sentence.split() for sentence in sentences]
      elif output_type is int:
          if self._vocab is None:
              raise TokenizerEncodeWithoutVocabError
          tokens = [
              self._vocab[sentence.split()] for sentence in sentences
          ]
      else:
          raise NotImplementedError
      if is_multiple_sentences:
          return tokens
      else:
          return tokens[0]
  
file_path: gluon-nlp/src/gluonnlp/data/tokenizers/whitespace.py
imports: from typing import Optional
  from .base import TOKENIZER_REGISTRY, BaseTokenizerWithVocab, TokenizerEncodeWithoutVocabError, TokenizerDecodeWithoutVocabError, TokenTypeNotSupportedError, rebuild_offset_from_tokens, is_tokens_from_multiple_sentences, get_token_type
  from ..vocab import Vocab
label_desc: Use image node_id 2 for calling the WhitespaceTokenizer obj's underlying member method code with example usage: obj.encode(sentences, output_type) and returns: tokens, tokens