Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

readingDirection and textLineOrder #2

Open
bertsky opened this issue Mar 31, 2021 · 7 comments
Open

readingDirection and textLineOrder #2

bertsky opened this issue Mar 31, 2021 · 7 comments

Comments

@bertsky
Copy link
Collaborator

bertsky commented Mar 31, 2021

Not sure if there's any equivalent for that in ALTO. Glyphs are supposed to be ordered by XML order. Spec does not say anything about words and lines though. IDNEXT is only for region-level ReadingOrder I guess (which you already have in the TODO).

But see PRImA-Research-Lab/PAGE-XML#26 for correct interpretation on the PAGE side.

@kba
Copy link
Member

kba commented Apr 1, 2021

IDNEXT is only for region-level ReadingOrder I guess (which you already have in the TODO).

It is also (trivially) implemented:

https://github.com/kba/page-to-alto/blob/46a8cc2fb74ce327e9d195f1095699cbae946cce/ocrd_page_to_alto/convert.py#L75-L78

@bertsky
Copy link
Collaborator Author

bertsky commented Apr 1, 2021

IDNEXT is only for region-level ReadingOrder I guess (which you already have in the TODO).

It is also (trivially) implemented:

Oh, right! So you can already set the check in the Readme, no?

Just curious: why depth=1 and not full recursion here and in convert_text? You can still make the hierarchy flat on the ALTO side, but not traversing recursively on the PAGE side will lose information. (And I would recommend being recursive on both sides BTW.)

@kba
Copy link
Member

kba commented Apr 7, 2021

why depth=1 and not full recursion here

Copy-Pasta, the reading order conversion should indeed be recursive.

and in convert_text

My idea was that convert_text should have an outer non-recursive loop and then have a region/block-specific inner loop. What I want to avoid is breaking table regions. What regions other than TableRegion can typically contain recursive regions?

@bertsky
Copy link
Collaborator Author

bertsky commented Apr 12, 2021

What regions other than TableRegion can typically contain recursive regions?

All regions can embed all other region types. As for typical cases, I don't know really. I guess that besides the pattern table→text, which is mandatory, the obvious text→text should be pretty pervasive due to cases like block→(heading|paragraph) or block→(drop-capital|paragraph) or block→(list-label|paragraph). Then there's of course image/graphics→text due to the caption relation. But one could think of many combinations, depending on the complexity of the layout and necessecity of representation...

I think we should try to be as general and agnostic as is possible.

@M3ssman
Copy link

M3ssman commented Apr 12, 2021

On the ALTO-side, one may express regions-in-regions as ComponentBlock elements. These are subtypes of ALTO-block types, alike TextBlock , Illustration or GraphicalBlock (layout elements of any sort) . A ComposedBlock might be annotated with @TYPE to show if it represent a table, a column or advertisement or any other, user defined text class.
This is an important use case for announcement/advertisement newspaper pages.

@bertsky
Copy link
Collaborator Author

bertsky commented Feb 4, 2022

BTW, on the line level, besides TextRegion/@textLineOrder we'd have to adhere to TextLine/@index ordering – both should influence the ALTO TextLine element ordering (but I don't know how the two attributes relate).

@bertsky
Copy link
Collaborator Author

bertsky commented Feb 7, 2022

BTW, on the line level, besides TextRegion/@textLineOrder we'd have to adhere to TextLine/@index ordering – both should influence the ALTO TextLine element ordering (but I don't know how the two attributes relate).

Perhaps we should simply make this configurable as in #27 for regions: --textline-order [document|index|textline-order] (but I wouldn't know how to implement the latter option, due to the aforementioned ambiguity in the semantics of that attribute).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants