code: def get_heteronym_spans(
      sentences: List[str], supported_heteronyms: Union[Dict, List]
  ):
      """
      Find heteronyms in sentences and returns span indices
  
      Args:
          sentences: sentences to find heteronyms in
          supported_heteronyms: heteronyms to look for
  
      Return:
          start_end: List[Tuple[int]] - start-end indices that indicate location of found heteronym in the sentence
          heteronyms: List[List[str]] - heteronyms found in sentences, each sentence can contain more than one heteronym
      """
      start_end = []
      heteronyms = []
      for sent in sentences:
          cur_start_end = []
          cur_heteronyms = []
          start_idx = 0
          for word in sent.lower().split():
              word_by_hyphen = word.split("-")
              for sub_word in word_by_hyphen:
                  no_punct_word = remove_punctuation(
                      sub_word, do_lower=True, remove_spaces=False
                  )
                  if no_punct_word in supported_heteronyms:
                      start_idx = sent.lower().index(
                          no_punct_word, start_idx
                      )
                      end_idx = start_idx + len(no_punct_word)
                      cur_start_end.append((start_idx, end_idx))
                      cur_heteronyms.append(no_punct_word)
                      start_idx = end_idx
                  else:
                      start_idx += len(sub_word) + 1
          heteronyms.append(cur_heteronyms)
          start_end.append(cur_start_end)
      return start_end, heteronyms
  
file_path: NeMo/nemo/collections/tts/g2p/utils.py
imports: import csv
  import os
  import re
  import string
  from typing import Dict, List, Union
label_desc: Use image node_id 4 for calling a global function with example usage: get_heteronym_spans(sentences, supported_heteronyms) and returns: start_end,  heteronyms