Skip to content

Commit

Permalink
Don't try alternate path for tessdata (#1328)
Browse files Browse the repository at this point in the history
This simplifies the code and the user interface.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
stweil authored and zdenop committed Feb 20, 2018
1 parent 2ca7d94 commit af6994e
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions ccmain/tessedit.cpp
Expand Up @@ -106,20 +106,10 @@ bool Tesseract::init_tesseract_lang_data(
// Initialize TessdataManager.
STRING tessdata_path = language_data_path_prefix + kTrainedDataSuffix;
if (!mgr->is_loaded() && !mgr->Init(tessdata_path.string())) {
// Try without tessdata.
m_data_sub_dir.set_value("");
main_setup(arg0, textbase);
language_data_path_prefix = datadir;
language_data_path_prefix += lang;
language_data_path_prefix += ".";
tessdata_path = language_data_path_prefix + kTrainedDataSuffix;
if (!mgr->Init(tessdata_path.string())) {
tprintf("Error opening data file %s\n", tessdata_path.string());
tprintf(
"Please make sure the TESSDATA_PREFIX environment variable is set"
" to your \"tessdata\" directory.\n");
return false;
}
tprintf("Error opening data file %s\n", tessdata_path.string());
tprintf("Please make sure the TESSDATA_PREFIX environment variable is set"
" to your \"tessdata\" directory.\n");
return false;
}
if (oem == OEM_DEFAULT) {
// Set the engine mode from availability, which can then be overidden by
Expand Down

0 comments on commit af6994e

Please sign in to comment.