code: def __init__(
      self,
      termbase_path,
      src_spacy_language_model,
      tgt_spacy_language_model,
      term_example_ratio,
      src_term_stoken,
      tgt_term_stoken,
      tgt_term_etoken,
      delimiter,
      term_corpus_ratio=0.2,
  ):
      self.term_example_ratio = term_example_ratio
      self.src_nlp = spacy.load(
          src_spacy_language_model, disable=["parser", "ner"]
      )
      self.tgt_nlp = spacy.load(
          tgt_spacy_language_model, disable=["parser", "ner"]
      )
  
      # We exclude tokenization for contractions in
      # order to avoid inconsistencies with pyonmtok's tokenization.
      # (e.g. "I ca n't" with spacy, "I can ' t" with pyonmttok)
      self.src_nlp.tokenizer.rules = {
          key: value
          for key, value in self.src_nlp.tokenizer.rules.items()
          if "'" not in key and "’" not in key and "‘" not in key
      }
      self.tgt_nlp.tokenizer.rules = {
          key: value
          for key, value in self.tgt_nlp.tokenizer.rules.items()
          if "'" not in key and "’" not in key and "‘" not in key
      }
      self.internal_termbase = self._create_internal_termbase(
          termbase_path
      )
      self.automaton = self._create_automaton()
      self.term_corpus_ratio = term_corpus_ratio
      self.src_term_stoken = src_term_stoken
      self.tgt_term_stoken = tgt_term_stoken
      self.tgt_term_etoken = tgt_term_etoken
      self.delimiter = delimiter
  
imports: from onmt.utils.logging import logger
  from onmt.transforms import register_transform
  from .transform import Transform
  import spacy
  import ahocorasick
  import re
label_desc: Use image node_id 1 to create a new TermMatcher object from inherited base classes: object with example: obj = TermMatcher(termbase_path, src_spacy_language_model, tgt_spacy_language_model, term_example_ratio, src_term_stoken, tgt_term_stoken, tgt_term_etoken, delimiter, term_corpus_ratio)