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_with_offsets(self, sentences, output_type=str):
      if output_type is int and self.vocab is None:
          raise TokenizerEncodeWithoutVocabError
      if output_type not in [int, str]:
          raise TokenTypeNotSupportedError(output_type)
      is_multiple_sentences = isinstance(sentences, list)
      if not is_multiple_sentences:
          sentences = [sentences]
      all_tokens = self.encode(sentences, output_type=str)
      offsets = []
      for ele_tokens, ele_sentence in zip(all_tokens, sentences):
          ele_offsets = rebuild_offset_from_tokens(
              ele_sentence, ele_tokens
          )
          offsets.append(ele_offsets)
      if is_multiple_sentences:
          return all_tokens, offsets
      else:
          return all_tokens[0], offsets[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 3 for calling the WhitespaceTokenizer obj's underlying member method code with example usage: obj.encode_with_offsets(sentences, output_type) and returns: all_tokens,  offsets, all_tokens,  offsets