Merge branch 'TAAS-89' into 'main'

TAAS-89: fixed weird bug with empty sections

See merge request fforesight/layout-parser!70
This commit is contained in:
Kilian Schüttler 2023-08-31 12:00:18 +02:00
commit aed4a55787
2 changed files with 9 additions and 3 deletions

View File

@ -76,16 +76,22 @@ public class TableCell implements GenericSemanticNode {
}
if (textBlock == null) {
textBlock = streamAllSubNodes().filter(SemanticNode::isLeaf).map(SemanticNode::getLeafTextBlock).collect(new TextBlockCollector());
textBlock = buildTextBlock();
}
return textBlock;
}
private TextBlock buildTextBlock() {
return streamAllSubNodes().filter(SemanticNode::isLeaf).map(SemanticNode::getLeafTextBlock).collect(new TextBlockCollector());
}
@Override
public String toString() {
return treeId + ": " + NodeType.TABLE_CELL + ": " + this.getTextBlock().buildSummary();
return treeId + ": " + NodeType.TABLE_CELL + ": " + this.buildTextBlock().buildSummary();
}
}

View File

@ -45,7 +45,7 @@ public class TablePageBlock extends AbstractPageBlock {
@Override
public boolean isEmpty() {
return unrotatedColCount == 0 || unrotatedRowCount == 0;
return getColCount() == 0 || getRowCount() == 0;
}
public List<List<Cell>> getRows() {