Skip to content

Commit eff16bd

Browse files
committed
Fix loading of sublangs (regression)
Model files which where defined with tessedit_load_sublangs in another model file where no longer loaded since Tesseract release 5.0.0-rc2. Fixes: 9091055 ("Fix loading of additional model files") Signed-off-by: Stefan Weil <[email protected]>
1 parent dfcd485 commit eff16bd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ccmain/tessedit.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,8 @@ int Tesseract::init_tesseract(const std::string &arg0, const std::string &textba
308308
// Load the rest into sub_langs_.
309309
// A range based for loop does not work here because langs_to_load
310310
// might be changed in the loop when a new submodel is found.
311-
for (auto &lang_to_load : langs_to_load) {
311+
for (size_t lang_index = 0; lang_index < langs_to_load.size(); ++lang_index) {
312+
auto &lang_to_load = langs_to_load[lang_index];
312313
if (!IsStrInList(lang_to_load, langs_not_to_load)) {
313314
const char *lang_str = lang_to_load.c_str();
314315
Tesseract *tess_to_init;

0 commit comments

Comments
 (0)