Extrapolation of baseline coordinates
In the ALTO XML exported from Transkribus, the baseline can be a single y-axis coordinate, which causes issues when imported in eScriptorium.
It is possible to solve this issue by extrapolating the baseline's coordinates using this y-axis coordinate and the x-axis coordinates of the parent TextBlock.
It is possible to solve this issue by extrapolating the baseline's coordinates using this y-axis coordinate and the extreme x-axis coordinates contained in @HPOS
and calculated from @WIDTH
.
Note the following elements:
ifTextBlock/Shape/Polygon/@POINTS
: Ax,Ay Bx,By Cx,Cy Dx,Dyand ifTextBlock/TextLine/@BASELINE
: BASELINEthenTextBlock/TextLine/@BASELINE
should be: Ax BASELINE Bx BASELINE-
TextBlock/TextLine/@BASELINE
should be: "{TextBlock/TextLine/@HPOS}
{TextBlock/TextLine/@BASELINE}
{TextBlock/TextLine/@HPOS
+TextBlock/TextLine/@BWIDTH}
{TextBlock/TextLine/@BASELINE}
"