src/ccmain/tessedit.cpp
int Tesseract::init_tesseract_internal(const std::string &arg0, const std::string &textbase,
                                       const std::string &language, OcrEngineMode oem,
                                       char **configs, int configs_size,
                                       const std::vector<std::string> *vars_vec,
                                       const std::vector<std::string> *vars_values,
                                       bool set_only_non_debug_params, TessdataManager *mgr) {
  if (!init_tesseract_lang_data(arg0, language, oem, configs, configs_size, vars_vec,
                                vars_values, set_only_non_debug_params, mgr)) {
    return -1;
  }
  if (tessedit_init_config_only) {
    return 0;
  }
  // If only LSTM will be used, skip loading Tesseract classifier's
  // pre-trained templates and dictionary.
  bool init_tesseract = tessedit_ocr_engine_mode != OEM_LSTM_ONLY;
  program_editup(textbase, init_tesseract ? mgr : nullptr, init_tesseract ? mgr : nullptr);
  return 0; // Normal exit
}
// Common initialization for a single language.
// arg0 is the datapath for the tessdata directory, which could be the
// path of the tessdata directory with no trailing /, or (if tessdata
// lives in the same directory as the executable, the path of the executable,
// hence the name arg0.
// textbase is an optional output file basename (used only for training)
// language is the language code to load.
// oem controls which engine(s) will operate on the image
// configs (argv) is an array of config filenames to load variables from.
// May be nullptr.
// configs_size (argc) is the number of elements in configs.
// vars_vec is an optional vector of variables to set.
// vars_values is an optional corresponding vector of values for the variables
// in vars_vec.
// If set_only_non_debug_params is true, only params that do not contain
// "debug" in the name will be set.
Common initialization for a single language.
arg0 is the datapath for the tessdata directory, which could be the
path of the tessdata directory with no trailing /, or (if tessdata
lives in the same directory as the executable, the path of the executable,
hence the name arg0.
textbase is an optional output file basename (used only for training)
language is the language code to load.
oem controls which engine(s) will operate on the image
configs (argv) is an array of config filenames to load variables from.
May be nullptr.
configs_size (argc) is the number of elements in configs.
vars_vec is an optional vector of variables to set.
vars_values is an optional corresponding vector of values for the variables
in vars_vec.
If set_only_non_debug_params is true, only params that do not contain
"debug" in the name will be set.
Common initialization for a single language . arg0 is the datapath for the tessdata directory which could be the path of the tessdata directory with no trailing / or ( if tessdata lives in the same directory as the executable the path of the executable hence the name arg0 . textbase is an optional output file basename ( used only for training ) language is the language code to load . oem controls which engine ( s ) will operate on the image configs ( argv ) is an array of config filenames to load variables from . May be nullptr . configs_size ( argc ) is the number of elements in configs . vars_vec is an optional vector of variables to set . vars_values is an optional corresponding vector of values for the variables in vars_vec . If set_only_non_debug_params is true only params that do not contain " debug " in the name will be set .
int Tesseract::init_tesseract_internal(const std::string &arg0, const std::string &textbase,
                                       const std::string &language, OcrEngineMode oem,
                                       char **configs, int configs_size,
                                       const std::vector<std::string> *vars_vec,
                                       const std::vector<std::string> *vars_values,
                                       bool set_only_non_debug_params, TessdataManager *mgr) {
  if (!init_tesseract_lang_data(arg0, language, oem, configs, configs_size, vars_vec,
                                vars_values, set_only_non_debug_params, mgr)) {
    return -1;
  }
  if (tessedit_init_config_only) {
    return 0;
  }
  bool init_tesseract = tessedit_ocr_engine_mode != OEM_LSTM_ONLY;
  program_editup(textbase, init_tesseract ? mgr : nullptr, init_tesseract ? mgr : nullptr);
  return 0; 
}
int Tesseract :: init_tesseract_internal ( const std :: string & arg0 , const std :: string & textbase , const std :: string & language , OcrEngineMode oem , char * * configs , int configs_size , const std :: vector < std :: string > * vars_vec , const std :: vector < std :: string > * vars_values , bool set_only_non_debug_params , TessdataManager * mgr ) { if ( ! init_tesseract_lang_data ( arg0 , language , oem , configs , configs_size , vars_vec , vars_values , set_only_non_debug_params , mgr ) ) { return -1 ; } if ( tessedit_init_config_only ) { return 0 ; } bool init_tesseract = tessedit_ocr_engine_mode != OEM_LSTM_ONLY ; program_editup ( textbase , init_tesseract ? mgr : nullptr , init_tesseract ? mgr : nullptr ) ; return 0 ; }
Common initialization for a single language.
Common initialization for a single language .
// If only LSTM will be used, skip loading Tesseract classifier's // pre-trained templates and dictionary. // Normal exit