def whitespace_split_with_indices(
    text: str) -> Tuple[List[str], List[int], List[int]]:
  """Whitespace splits a text into unigrams and returns indices mapping."""
  if not isinstance(text, str):
    raise ValueError("The input text is not of unicode format.")
  unigrams = []
  unigram_to_char_map = []
  char_to_unigram_map = []
  prev_is_separator = True
  for i, c in enumerate(text):
    if c in _WHITESPACE_DELIMITER:
      prev_is_separator = True
    else:
      if prev_is_separator:
        unigrams.append(c)
        unigram_to_char_map.append(i)
      else:
        unigrams[-1] += c
      prev_is_separator = False
    char_to_unigram_map.append(len(unigrams) - 1)
  return unigrams, unigram_to_char_map, char_to_unigram_map