class_docstr: Gather the dataset files. Specifically for the paired annotations. That
  is to say, each image has a corresponding annotation file. For example,
  
          img_1.jpg <---> gt_img_1.txt
          img_2.jpg <---> gt_img_2.txt
          img_3.jpg <---> gt_img_3.txt
  
  Args:
      img_suffixes (List[str]): File suffixes that used for searching.
      rule (Sequence): The rule for pairing the files. The first element is
          the matching pattern for the file, and the second element is the
          replacement pattern, which should be a regular expression. For
          example, to map the image name img_1.jpg to the annotation name
          gt_img_1.txt, the rule is
          [r'img_(\d+)\.([jJ][pP][gG])', r'gt_img_.txt'] # noqa: W605 E501
  
  Note: PairGatherer assumes that each split annotation file is in the
  correspond split directory. For example, all the train annotation files are
  in {ann_dir}/train.
code: def __init__(
      self,
      img_suffixes: Optional[List[str]] = None,
      rule: Optional[List[str]] = None,
      **kwargs,
  ) -> None:
      super().__init__(**kwargs)
      self.rule = rule
      self.img_suffixes = img_suffixes
      # ann_dir = {ann_root}/{ann_dir}/{split}
      self.ann_dir = osp.join(self.ann_dir, self.split)
  
file_path: mmocr/mmocr/datasets/preparers/gatherers/pair_gatherer.py
imports: import os.path
  import re
  from typing import List, Optional, Tuple
  from mmocr.registry import DATA_GATHERERS
  from mmocr.utils import list_files
  from .base import BaseGatherer
label_desc: Use image node_id 1 to create a new PairGatherer object from inherited base classes: BaseGatherer with example: obj = PairGatherer(img_suffixes, rule)