RED-8670: add table detection from idp result

* some 'slight' refactoring
This commit is contained in:
Kilian Schuettler 2025-01-09 13:26:09 +01:00
parent 853a2e62aa
commit 6aeb8c7795

View File

@ -114,6 +114,8 @@ public class TableGridStructureCalculator {
}
List<List<Cell>> rows = buildRows(cells);
if (isNotRectangular(rows)) {
// For some tables the result is not rectangular, this either happens if cells are missing or the algorithm would need more than the max iterations to solve it.
// This is unacceptable so we revert to the area sweep implementation, which by design will always produce a rectangular result.
return areaSweepFallback();
}
rows = removeEmptyRows(rows);