use of eu.transkribus.core.model.beans.pagecontent.TableRegionType in project TranskribusCore by Transkribus.
the class PageXmlUtils method getTextRegions.
public static List<TextRegionType> getTextRegions(PcGtsType pc) {
List<TrpRegionType> regions = pc.getPage().getTextRegionOrImageRegionOrLineDrawingRegion();
List<TextRegionType> tRegions = new ArrayList<>();
if (regions == null || regions.isEmpty()) {
return tRegions;
}
for (RegionType r : regions) {
if (r == null)
continue;
if (TextRegionType.class.isAssignableFrom(r.getClass())) {
tRegions.add((TextRegionType) r);
}
if (TableRegionType.class.isAssignableFrom(r.getClass())) {
TableRegionType table = (TableRegionType) r;
tRegions.addAll(table.getTableCell());
}
}
return tRegions;
}
Aggregations