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

default workflow(s): utilise --lang and --script info #67

Open
bertsky opened this issue Aug 14, 2023 · 1 comment
Open

default workflow(s): utilise --lang and --script info #67

bertsky opened this issue Aug 14, 2023 · 1 comment

Comments

@bertsky
Copy link
Member

bertsky commented Aug 14, 2023

For example, with ocrd-tesserocr-recognize we could do something like:

shopt -s nocasematch
MODEL=eng
case "$LANGUAGE" in
  de|deu|ger) MODEL=deu
    case "$SCRIPT" in
      Fraktur) MODEL=frak2021;;
      ...
    esac;;
  fr|fre|fra) MODEL=fra;;
  hsb) MODEL=hsb
    case "$SCRIPT" in
      Fraktur) MODEL=hsbfraktur;;
      ...
    esac;;
  ...
esac

The question is: do we only apply this when no --workflow is supplied, or should we assume that all workflow files themselves may contain placeholders, e.g. $TESSMODEL, which we must replace on the fly?

@bertsky
Copy link
Member Author

bertsky commented Dec 5, 2023

At least for ocrd-tesserocr-recognize, we can also parameterise dynamically (via XPath queries): xpath_model e.g.

{
"contains('de,deu,ger',@language) and starts-with(@script,'Latf')": "frak2021", 
"contains('fr,fre,fra',@language)": "fra", 
"@language='hsb') and starts-with(@script,'Latf')": "hsbfraktur",
"@language='hsb')": "hsblatin",
"": "eng"
}

And as workaround for the missing MODS inheritance, we could simply write a dummy processor that fills the respective PAGE attributes from MODS...

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