diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/services/tables/TableGridStructureCalculator.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/services/tables/TableGridStructureCalculator.java index b33a86c..6b233bc 100644 --- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/services/tables/TableGridStructureCalculator.java +++ b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/services/tables/TableGridStructureCalculator.java @@ -114,6 +114,8 @@ public class TableGridStructureCalculator { } List> 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);