def __init__(self, mentions, lines, region, min_cell_size=<NUM_LIT>):
self.min_cell_size = min_cell_size<EOL>vlines, hlines = _split_vlines_hlines(lines)<EOL>self.xs = [v.xc for v in vlines]<EOL>self.ys = [h.yc for h in hlines]<EOL>self.xs = _retain_centroids(self.xs + [region.x0, region.x1], min_cell_size)<EOL>self.ys = _retain_centroids(self.ys + [region.y0, region.y1], min_cell_size)<EOL>self.xranges = list(zip(self.xs, self.xs[<NUM_LIT:1>:]))<EOL>self.yranges = list(zip(self.ys, self.ys[<NUM_LIT:1>:]))<EOL>self.num_cols = len(self.xranges)<EOL>self.num_rows = len(self.yranges)<EOL>self._grid = np.full(<EOL>[self.num_rows, self.num_cols], None, dtype=np.dtype(object)<EOL>)<EOL>grid = self._grid<EOL>line_plane = Plane(region.bbox)<EOL>line_plane.extend(lines)<EOL>vbars, hbars = self._mark_grid_bounds(line_plane, region)<EOL>cells = []<EOL>for i in range(self.num_rows):<EOL><INDENT>for j in range(self.num_cols):<EOL><INDENT>if grid[i, j]:<EOL><INDENT>continue  <EOL><DEDENT>if i > <NUM_LIT:0> and not hbars[i, j]:<EOL><INDENT>grid[i, j] = cell = grid[i - <NUM_LIT:1>, j]<EOL>cell.rowend = i + <NUM_LIT:1><EOL><DEDENT>elif j > <NUM_LIT:0> and not vbars[i, j]:<EOL><INDENT>grid[i, j] = cell = grid[i, j - <NUM_LIT:1>]<EOL>cell.colend = j + <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>grid[i, j] = cell = Cell([i, j])<EOL>cells.append(cell)<EOL><DEDENT><DEDENT><DEDENT>text_plane = Plane(region.bbox)<EOL>text_plane.extend(mentions)<EOL>for cell in cells:<EOL><INDENT>x0 = self.xs[cell.colstart]<EOL>x1 = self.xs[cell.colend]<EOL>y0 = self.ys[cell.rowstart]<EOL>y1 = self.ys[cell.rowend]<EOL>bbox = (x0, y0, x1, y1)<EOL>cell.texts = [<EOL>m for m in text_plane.find(bbox) if inside(bbox, (m.xc, m.yc) * <NUM_LIT:2>)<EOL>]<EOL><DEDENT>self.get_normalized_grid()<EOL>
Constructor