code: def get_split_indices(
      word, curr_tokens, include_joiner_token, joiner
  ):
      """Gets indices for valid substrings of word, for iterations > 0.
  
      For iterations > 0, rather than considering every possible substring, we only
      want to consider starting points corresponding to the start of wordpieces in
      the current vocabulary.
  
      Args:
        word: string we want to split into substrings
        curr_tokens: string to int dict of tokens in vocab (from previous iteration)
        include_joiner_token: bool whether to include joiner token
        joiner: string used to indicate suffixes
  
      Returns:
        list of ints containing valid starting indices for word
      """
  
      indices = []
      start = 0
      while start < len(word):
          end = len(word)
          while end > start:
              subtoken = word[start:end]
              # Subtoken includes the joiner token.
              if include_joiner_token and start > 0:
                  subtoken = joiner + subtoken
              # If subtoken is part of vocab, 'end' is a valid start index.
              if subtoken in curr_tokens:
                  indices.append(end)
                  break
              end -= 1
  
          if end == start:
              return None
          start = end
  
      return indices
  
file_path: text/tensorflow_text/tools/wordpiece_vocab/wordpiece_tokenizer_learner_lib.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  from typing import List, Optional
  import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: get_split_indices(word, curr_tokens, include_joiner_token, joiner) and returns: indices, None