code: def __call__(self, doc: Doc) -> Doc:
      normalizers: List[Callable[[Token], str]] = [lambda x: x.text]
      if self.lower:
          normalizers.append(lambda x: x.text.lower())
      if self.lemma:
          normalizers.append(lambda x: x.lemma_)
      if self.normalizer is not None:
          normalizers.append(self.normalizer)
  
      spans: Iterable[Tuple[int, int]] = []
      for normalizer in normalizers:
          spans = itertools.chain(
              spans,
              self._search_by_normalizer(
                  doc, normalizer, ignore_space=False
              ),
          )
          if self.ignore_space:
              spans = itertools.chain(
                  spans,
                  self._search_by_normalizer(
                      doc, normalizer, ignore_space=True
                  ),
              )
  
      ents = list(doc.ents)
      for i, j in spans:
          ent = Span(doc, i, j, label=self.label)
          ents.append(ent)
      selected = textspan.remove_span_overlaps_idx(
          [(s.start, s.end) for s in ents]
      )
      doc.ents = tuple(ents[i] for i in selected)
      return doc
  
file_path: camphr/packages/camphr_pattern_search/camphr_pattern_search/__init__.py
imports: import itertools
  from typing import Callable, Iterable, Iterator, List, Optional, Tuple
  import ahocorasick
  from spacy.tokens.token import Token
  import textspan
  from spacy.tokens import Doc, Span
label_desc: Use image node_id 6 for calling the PatternSearcher obj's underlying member method code with example usage: obj.__call__(doc) and returns: doc