def __init__(self, field, fid, phrases, candidate_lines,
                 bbox=None, min_height=0, max_height=MAX_LENGTH, min_width=0,
                 max_width=MAX_LENGTH, min_page=0, max_page=None):
        """ Set parameters for the candidate search.

        :param field: The field to search for.
        :param fid: The finder id of this object.
        :param phrases: The phrases to look for in the box.
        :param candidate_lines: The indices of the lines to be designated
         candidates.
        :param bbox: The bounding box within which to search.
        :param min_height: The minimum height box to consider.
        :param max_height: The maximum height box to consider.
        :param min_width: The minimum width box to consider.
        :param max_width: The maximum width box to consider.
        :param min_page: The minimum page number to look on.
        :param max_height: The maximum page number to look on.
        """
        self._phrases = phrases
        self._candidate_lines = candidate_lines
        self._counts = {}
        self._min_height = min_height
        self._max_height = max_height
        self._min_width = min_width
        self._max_width = max_width
        self._min_page = min_page
        self._max_page = max_page
        self._bbox = bbox if bbox else [0, 0, MAX_LENGTH, MAX_LENGTH]
        CandidateFinder.__init__(self, field, fid)
    def __init__(self, field, fid, max_xgap=MAX_LENGTH, max_ygap=MAX_LENGTH, bbox=None):
        """Set up parameters for the candidate search.

        :param field: The field to find.
        :param fid: The finder id of this object.
        :param max_xgap: The largest horizontal gap between label and candidate.
        :param max_ygap: The largest vertical gap between label and candidate.
        :param bbox: The bounding box in which to search.
        :return:
        """
        self._max_xgap = max_xgap
        self._max_ygap = max_ygap
        self._counts = {}
        self._bbox = bbox if bbox else [0, 0, MAX_LENGTH, MAX_LENGTH]
        CandidateFinder.__init__(self, field, fid)
Example #3
0
    def __init__(self,
                 field,
                 fid,
                 max_xgap=MAX_LENGTH,
                 max_ygap=MAX_LENGTH,
                 bbox=None):
        """Set up parameters for the candidate search.

        :param field: The field to find.
        :param fid: The finder id of this object.
        :param max_xgap: The largest horizontal gap between label and candidate.
        :param max_ygap: The largest vertical gap between label and candidate.
        :param bbox: The bounding box in which to search.
        :return:
        """
        self._max_xgap = max_xgap
        self._max_ygap = max_ygap
        self._counts = {}
        self._bbox = bbox if bbox else [0, 0, MAX_LENGTH, MAX_LENGTH]
        CandidateFinder.__init__(self, field, fid)