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:
commit
aed4a55787
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -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() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user