class_docstr: Normalize source and target based on Moses script.
class_docstr_tok: ["Normalize","source","and","target","based","on","Moses","script","."]
docstr: Normalize source and target examples.
docstr_tok: ["Normalize","source","and","target","examples","."]
code: def apply(self, example, is_train=False, stats=None, **kwargs):
      """Normalize source and target examples."""
      corpus_name = kwargs.get("corpus_name", None)
      if corpus_name is None:
          raise ValueError("corpus_name is required.")
  
      src_str = self.mpn.normalize(
          " ".join(example["src"]),
          self.src_lang_dict[corpus_name],
          self.penn_dict[corpus_name],
          self.norm_quote_commas_dict[corpus_name],
          self.norm_numbers_dict[corpus_name],
          self.pre_dict[corpus_name],
          self.post_dict[corpus_name],
      )
      example["src"] = src_str.split()
  
      if example["tgt"] is not None:
          tgt_str = self.mpn.normalize(
              " ".join(example["tgt"]),
              self.tgt_lang_dict[corpus_name],
              self.penn_dict[corpus_name],
              self.norm_quote_commas_dict[corpus_name],
              self.norm_numbers_dict[corpus_name],
              self.pre_dict[corpus_name],
              self.post_dict[corpus_name],
          )
          example["tgt"] = tgt_str.split()
  
      return example
  
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 7 for calling the NormalizeTransform obj's underlying member method code with example usage: obj.apply(example, is_train, stats) and returns: example