class_docstr: Base class for parsing annotations.
  
  Args:
      split (str): The split of the dataset. It is usually set automatically
          and users do not need to set it manually in config file in most
          cases.
      nproc (int): Number of processes to process the data. Defaults to 1.
          It is usually set automatically and users do not need to set it
          manually in config file in most cases.
docstr: A basic loader designed for .txt format annotation. It greedily
  extracts information separated by separators.
  
  Args:
      file_path (str): Path to the txt file.
      separator (str, optional): Separator of data. Defaults to ','.
      format (str, optional): Annotation format.
          Defaults to 'x1,y1,x2,y2,x3,y3,x4,y4,trans'.
      encoding (str, optional): Encoding format. Defaults to 'utf-8'.
  
  Yields:
      Iterator[Union[Dict, str]]: Original text line or a dict containing
      the information of the text line.
code: def loader(
      self,
      file_path: str,
      separator: str = ",",
      format: str = "x1,y1,x2,y2,x3,y3,x4,y4,trans",
      encoding="utf-8",
  ) -> Union[Dict, str]:
      """A basic loader designed for .txt format annotation. It greedily
      extracts information separated by separators.
  
      Args:
          file_path (str): Path to the txt file.
          separator (str, optional): Separator of data. Defaults to ','.
          format (str, optional): Annotation format.
              Defaults to 'x1,y1,x2,y2,x3,y3,x4,y4,trans'.
          encoding (str, optional): Encoding format. Defaults to 'utf-8'.
  
      Yields:
          Iterator[Union[Dict, str]]: Original text line or a dict containing
          the information of the text line.
      """
      keys = format.split(separator)
      with open(file_path, "r", encoding=encoding) as f:
          for line in f.readlines():
              line = line.strip()
              values = line.split(separator)
              values = values[: len(keys) - 1] + [
                  separator.join(values[len(keys) - 1 :])
              ]
              if line:
                  yield dict(zip(keys, values))
  
file_path: mmocr/mmocr/datasets/preparers/parsers/base.py
imports: from abc import abstractmethod
  from typing import Dict, List, Tuple, Union
  from mmocr.utils import track_parallel_progress_multi_args
label_desc: Use image node_id 5 for calling the BaseParser obj's underlying member method code with example usage: obj.loader(file_path, separator, format, encoding) without return types