You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"textequiv-index": {
"type": "string",
"enum": ["first", "last", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
"default": "first",
"description": "Only extract lines with the specified TextEquiv/@index entries; 'first' and 'last' denote the first and last TextEquiv elements, regardless of their @index, respectively."
}
Okay, let's run with ocrd-segment-extract-lines -P textequiv-index 0 then.
This is what happens:
Exception: Invalid parameters ["[textequiv-index] 0 is not of type 'string'", "[textequiv-index] 0 is not one of ['first', 'last', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9']"]
Apparently, the parser decodes the 0 as number, simply because it can. It does not bother to look into the tool json's type.
Is that really what we want?
(Workaround on the user side, of course, is: -P textequiv-index '"0"', but this is ugly and surprising. Surprising, because I can write -P textequiv-index first without the quotes.)
The text was updated successfully, but these errors were encountered:
Suppose I want to have:
Okay, let's run with
ocrd-segment-extract-lines -P textequiv-index 0
then.This is what happens:
This is why:
core/ocrd_utils/ocrd_utils/introspect.py
Lines 10 to 17 in e841ce8
Apparently, the parser decodes the
0
as number, simply because it can. It does not bother to look into the tool json'stype
.Is that really what we want?
(Workaround on the user side, of course, is:
-P textequiv-index '"0"'
, but this is ugly and surprising. Surprising, because I can write-P textequiv-index first
without the quotes.)The text was updated successfully, but these errors were encountered: