class_docstr: This is a Python port of the Moses punctuation normalizer
class_docstr_tok: ["This","is","a","Python","port","of","the","Moses","punctuation","normalizer"]
docstr: Returns a string with normalized punctuation.
  :param language: The two-letter language code.
  :type lang: str
  :param penn: Normalize Penn Treebank style quotations.
  :type penn: bool
  :param norm_quote_commas: Normalize quotations and commas
  :type norm_quote_commas: bool
  :param norm_numbers: Normalize numbers
  :type norm_numbers: bool
docstr_tok: ["Returns","a","string","with","normalized","punctuation",".",":","param","language",":","The","two-letter","language","code",".",":","type","lang",":","str",":","param","penn",":","Normalize","Penn","Treebank","style","quotations",".",":","type","penn",":","bool",":","param","norm_quote_commas",":","Normalize","quotations","and","commas",":","type","norm_quote_commas",":","bool",":","param","norm_numbers",":","Normalize","numbers",":","type","norm_numbers",":","bool"]
code: def normalize(
      self,
      text,
      lang="en",
      penn=True,
      norm_quote_commas=True,
      norm_numbers=True,
      pre_replace_unicode_punct=False,
      post_remove_control_chars=False,
  ):
      """
      Returns a string with normalized punctuation.
      :param language: The two-letter language code.
      :type lang: str
      :param penn: Normalize Penn Treebank style quotations.
      :type penn: bool
      :param norm_quote_commas: Normalize quotations and commas
      :type norm_quote_commas: bool
      :param norm_numbers: Normalize numbers
      :type norm_numbers: bool
      """
      self.substitutions = [
          self.EXTRA_WHITESPACE,
          self.NORMALIZE_UNICODE,
          self.FRENCH_QUOTES,
          self.HANDLE_PSEUDO_SPACES,
      ]
  
      if penn:
          # Adds the penn substitutions after extra_whitespace regexes.
          self.substitutions.insert(
              1, self.NORMALIZE_UNICODE_IF_NOT_PENN
          )
  
      if norm_quote_commas:
          if lang == "en":
              self.substitutions.append(
                  self.EN_QUOTATION_FOLLOWED_BY_COMMA
              )
          elif lang in ["de", "es", "fr"]:
              self.substitutions.append(
                  self.DE_ES_FR_QUOTATION_FOLLOWED_BY_COMMA
              )
  
      if norm_numbers:
          if lang in ["de", "es", "cz", "cs", "fr"]:
              self.substitutions.append(self.DE_ES_CZ_CS_FR)
          else:
              self.substitutions.append(self.OTHER)
  
      self.substitutions = list(chain(*self.substitutions))
  
      # Optionally, replace unicode puncts BEFORE normalization.
      if pre_replace_unicode_punct:
          text = self.replace_unicode_punct(text)
  
      # Actual normalization.
      for regexp, substitution in self.substitutions:
          text = re.sub(regexp, substitution, str(text))
  
      # Optionally, replace unicode puncts BEFORE normalization.
      if post_remove_control_chars:
          text = self.remove_control_chars(text)
  
      return text.strip()
  
imports: from onmt.utils.logging import logger
  import re
  import regex
  from itertools import chain
  from onmt.transforms import register_transform
  from .transform import Transform
label_desc: Use image node_id 2 for calling the MosesPunctNormalizer obj's underlying member method code with example usage: obj.normalize(text, lang, penn, norm_quote_commas, norm_numbers, pre_replace_unicode_punct, post_remove_control_chars) and returns: text