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

ReadingOrder: be robust if missing #18

Open
bertsky opened this issue May 12, 2023 · 0 comments
Open

ReadingOrder: be robust if missing #18

bertsky opened this issue May 12, 2023 · 0 comments

Comments

@bertsky
Copy link
Collaborator

bertsky commented May 12, 2023

Currently, if the input has no ReadingOrder or no OrderedGroup, then we get:

Traceback (most recent call last):
  File "/data/ocr-d/ocrd_all/venv/bin/transkribus-to-prima", line 8, in <module>
    sys.exit(cli())
  File "/data/ocr-d/ocrd_all/venv/lib/python3.7/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/data/ocr-d/ocrd_all/venv/lib/python3.7/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/data/ocr-d/ocrd_all/venv/lib/python3.7/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/data/ocr-d/ocrd_all/venv/lib/python3.7/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/data/ocr-d/ocrd_all/venv/lib/python3.7/site-packages/transkribus_to_prima/cli.py", line 27, in cli
    getattr(converter, f'convert_{convert}')()
  File "/data/ocr-d/ocrd_all/venv/lib/python3.7/site-packages/transkribus_to_prima/convert.py", line 29, in convert_reading_order
    ro = self.tree.xpath('//*[local-name()="ReadingOrder"]/*[local-name()="OrderedGroup"]')[0]
IndexError: list index out of range
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

1 participant