class_docstr: Handle punctuations in text.
  
  Just strip punctuations from text or strip and restore them later.
  
  Args:
      puncs (str): The punctuations to be processed. Defaults to `_DEF_PUNCS`.
  
  Example:
      >>> punc = Punctuation()
      >>> punc.strip("This is. example !")
      'This is example'
  
      >>> text_striped, punc_map = punc.strip_to_restore("This is. example !")
      >>> ' '.join(text_striped)
      'This is example'
  
      >>> text_restored = punc.restore(text_striped, punc_map)
      >>> text_restored[0]
      'This is. example !'
docstr: Auxiliary method for Punctuation.preserve()
docstr_tok: ["Auxiliary","method","for","Punctuation.preserve","(",")"]
code: def _strip_to_restore(self, text):
      """Auxiliary method for Punctuation.preserve()"""
      matches = list(re.finditer(self.puncs_regular_exp, text))
      if not matches:
          return [text], []
      # the text is only punctuations
      if len(matches) == 1 and matches[0].group() == text:
          return [], [_PUNC_IDX(text, PuncPosition.BEGIN)]
      # build a punctuation map to be used later to restore punctuations
      puncs = []
      for match in matches:
          position = PuncPosition.MIDDLE
          if match == matches[0] and text.startswith(match.group()):
              position = PuncPosition.BEGIN
          elif match == matches[-1] and text.endswith(match.group()):
              position = PuncPosition.END
          puncs.append(_PUNC_IDX(match.group(), position))
      # convert str text to a List[str], each item is separated by a punctuation
      splitted_text = []
      for idx, punc in enumerate(puncs):
          split = text.split(punc.punc)
          prefix, suffix = split[0], punc.punc.join(split[1:])
          text = suffix
          if prefix == "":
              # We don't want to insert an empty string in case of initial punctuation
              continue
          splitted_text.append(prefix)
          # if the text does not end with a punctuation, add it to the last item
          if idx == len(puncs) - 1 and len(suffix) > 0:
              splitted_text.append(suffix)
      return splitted_text, puncs
  
file_path: TTS/TTS/tts/utils/text/punctuation.py
imports: import collections
  import re
  from enum import Enum
  import six
label_desc: Use image node_id 7 for calling the Punctuation obj's underlying member method code with example usage: obj._strip_to_restore(text) and returns: splitted_text,  puncs, list,  list, list,  list