Skip to content

OcrdMets.find_files: improve search for pageId#955

Merged
kba merged 3 commits intomasterfrom
page-id-flag
Nov 23, 2022
Merged

OcrdMets.find_files: improve search for pageId#955
kba merged 3 commits intomasterfrom
page-id-flag

Conversation

@kba
Copy link
Copy Markdown
Member

@kba kba commented Nov 17, 2022

Adressing #921:

  • regular expression, range and literal values can be combined now, e.g. ocrd workspace find --page-id "PHYS_0001..PHYS_0010,//PHYS_.*[02468],PHYS_9999" will search for
    • PHYS_0001, PHYS_0002 ... PHYS_0010
    • every pageId that starts with PHYS_ and ends with an even number
    • PHYS_9999
  • if generating a range:
    • use the last not the first number for the range, because pageIds can have multiple sets of numbers in them. E.g. PHYS_1234_0001..PHYS_1234_0010 did produce a single match PHYS_1234_0001, now it will iterate over the last number part.
    • If the latter case happens, i.e. start equals end number, this will raise a ValueError now.

@kba kba requested a review from bertsky November 17, 2022 17:23
Copy link
Copy Markdown
Collaborator

@bertsky bertsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent, thanks!

@bertsky bertsky self-requested a review November 18, 2022 21:08
@kba kba mentioned this pull request Nov 20, 2022
@kba kba merged commit f7a0f5b into master Nov 23, 2022
@kba kba deleted the page-id-flag branch November 17, 2023 13:11
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

Successfully merging this pull request may close these issues.

2 participants