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.restore()
docstr_tok: ["Auxiliary","method","for","Punctuation.restore","(",")"]
code: def _restore(
      cls, text, puncs
  ):  # pylint: disable=too-many-return-statements
      """Auxiliary method for Punctuation.restore()"""
      if not puncs:
          return text
  
      # nothing have been phonemized, returns the puncs alone
      if not text:
          return ["".join(m.punc for m in puncs)]
  
      current = puncs[0]
  
      if current.position == PuncPosition.BEGIN:
          return cls._restore(
              [current.punc + text[0]] + text[1:], puncs[1:]
          )
  
      if current.position == PuncPosition.END:
          return [text[0] + current.punc] + cls._restore(
              text[1:], puncs[1:]
          )
  
      # POSITION == MIDDLE
      if len(text) == 1:  # pragma: nocover
          # a corner case where the final part of an intermediate
          # mark (I) has not been phonemized
          return cls._restore([text[0] + current.punc], puncs[1:])
  
      return cls._restore(
          [text[0] + current.punc + text[1]] + text[2:], puncs[1:]
      )
  
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 9 for calling the Punctuation obj's underlying member method code with example usage: obj._restore(cls, text, puncs) and returns: cls, text, list, cls, unknown, cls