write runtime parameters to HOCR output
Your Feature Request
this is a more generic feature request than
- #4455
based on
Good point about compound model names. The current implementation does exact lookup, so
deu_latfpasses through unmapped instead of resolving tode.I'll add prefix-based fallback: strip trailing
_suffixparts progressively and retry shorter keys.deu_latf-> trydeu-> "de".chi_tra_vert-> trychi_tra-> "zh".
reducing languages like German Fraktur script (deu_latf) to German (deu)
can be too lossy for consumers of HOCR files
for example, one use case is to re-run tesseract with the exact same parameters (reproducible runs)
to encode the runtime parameters, we could use a custom meta tag like ocr-runtime-parameters
with the parameters stored in a JSON object
<meta name="ocr-runtime-parameters" content='{
"langs": "eng+fra",
"tessdata-hashes": {
"eng": "sha256:8280aed0782fe27257a68ea10fe7ef324ca0f8d85bd2fd145d1c2b560bcb66ba",
"fra": "sha256:907743d98915c91a3906dfbf6e48b97598346698fe53aaa797e1a064ffcac913"
}
}'/>
the example file hashes are from tessdata_best
optional: also store file hashes of input image files
Source: tesseract-ocr/tesseract