Fills a table skeleton's cells with a region's OCR lines: each line's box
center is assigned to its nearest row and column cluster, and lines that
land in the same cell are joined with spaces. Without a usable grid (no
rows, no columns or no lines) the cells are filled in document order.
Known limit: a line whose center falls inside a rowspan's vertical extent
lands on a row where that column has no <td> (the span occupies it), so
its text is dropped. Occupancy is tracked; routing into spanned cells is not.
Parameters
html: string
The structure HTML with empty <td></td> cells, as the
structure decoder emits it.
Fills a table skeleton's cells with a region's OCR lines: each line's box center is assigned to its nearest row and column cluster, and lines that land in the same cell are joined with spaces. Without a usable grid (no rows, no columns or no lines) the cells are filled in document order.
Known limit: a line whose center falls inside a rowspan's vertical extent lands on a row where that column has no
<td>(the span occupies it), so its text is dropped. Occupancy is tracked; routing into spanned cells is not.