diff --git a/include/tesseract/baseapi.h b/include/tesseract/baseapi.h index e3731ebaf..2e33849f2 100644 --- a/include/tesseract/baseapi.h +++ b/include/tesseract/baseapi.h @@ -247,14 +247,6 @@ public: */ void GetAvailableLanguagesAsVector(std::vector *langs) const; - /** - * Init only the lang model component of Tesseract. The only functions - * that work after this init are SetVariable and IsValidWord. - * WARNING: temporary! This function will be removed from here and placed - * in a separate API at some future time. - */ - int InitLangMod(const char *datapath, const char *language); - /** * Init only for page layout analysis. Use only for calls to SetImage and * AnalysePage. Calls that attempt recognition will generate an error. diff --git a/include/tesseract/capi.h b/include/tesseract/capi.h index eae114d46..e9e91a4b8 100644 --- a/include/tesseract/capi.h +++ b/include/tesseract/capi.h @@ -240,8 +240,6 @@ TESS_API char **TessBaseAPIGetLoadedLanguagesAsVector( TESS_API char **TessBaseAPIGetAvailableLanguagesAsVector( const TessBaseAPI *handle); -TESS_API int TessBaseAPIInitLangMod(TessBaseAPI *handle, const char *datapath, - const char *language); TESS_API void TessBaseAPIInitForAnalysePage(TessBaseAPI *handle); TESS_API void TessBaseAPIReadConfigFile(TessBaseAPI *handle, diff --git a/src/api/baseapi.cpp b/src/api/baseapi.cpp index 662dae541..7232d34e7 100644 --- a/src/api/baseapi.cpp +++ b/src/api/baseapi.cpp @@ -474,25 +474,6 @@ void TessBaseAPI::GetAvailableLanguagesAsVector(std::vector *langs) } } -// TODO(amit): Adapt to lstm -#ifndef DISABLED_LEGACY_ENGINE -/** - * Init only the lang model component of Tesseract. The only functions - * that work after this init are SetVariable and IsValidWord. - * WARNING: temporary! This function will be removed from here and placed - * in a separate API at some future time. - */ -int TessBaseAPI::InitLangMod(const char *datapath, const char *language) { - if (tesseract_ == nullptr) { - tesseract_ = new Tesseract; - } else { - ParamUtils::ResetToDefaults(tesseract_->params()); - } - TessdataManager mgr; - return tesseract_->init_tesseract_lm(datapath, nullptr, language, &mgr); -} -#endif // ndef DISABLED_LEGACY_ENGINE - /** * Init only for page layout analysis. Use only for calls to SetImage and * AnalysePage. Calls that attempt recognition will generate an error. diff --git a/src/api/capi.cpp b/src/api/capi.cpp index 12459a3aa..87aa38373 100644 --- a/src/api/capi.cpp +++ b/src/api/capi.cpp @@ -254,12 +254,6 @@ char **TessBaseAPIGetAvailableLanguagesAsVector(const TessBaseAPI *handle) { return arr; } -#ifndef DISABLED_LEGACY_ENGINE -int TessBaseAPIInitLangMod(TessBaseAPI *handle, const char *datapath, const char *language) { - return handle->InitLangMod(datapath, language); -} -#endif - void TessBaseAPIInitForAnalysePage(TessBaseAPI *handle) { handle->InitForAnalysePage(); } diff --git a/src/ccmain/tessedit.cpp b/src/ccmain/tessedit.cpp index a07c934e8..c739e58ab 100644 --- a/src/ccmain/tessedit.cpp +++ b/src/ccmain/tessedit.cpp @@ -453,19 +453,6 @@ void Tesseract::SetupUniversalFontIds() { font_table_size_ = all_fonts.size(); } -// init the LM component -int Tesseract::init_tesseract_lm(const std::string &arg0, const std::string &textbase, - const std::string &language, TessdataManager *mgr) { - if (!init_tesseract_lang_data(arg0, textbase, language, OEM_TESSERACT_ONLY, nullptr, 0, nullptr, - nullptr, false, mgr)) { - return -1; - } - getDict().SetupForLoad(Dict::GlobalDawgCache()); - getDict().Load(lang, mgr); - getDict().FinishLoad(); - return 0; -} - #endif // ndef DISABLED_LEGACY_ENGINE void Tesseract::end_tesseract() { diff --git a/src/ccmain/tesseractclass.h b/src/ccmain/tesseractclass.h index 4a49b398f..ef5d14159 100644 --- a/src/ccmain/tesseractclass.h +++ b/src/ccmain/tesseractclass.h @@ -523,9 +523,6 @@ public: // instances of the same font loaded. void SetupUniversalFontIds(); - int init_tesseract_lm(const std::string &arg0, const std::string &textbase, - const std::string &language, TessdataManager *mgr); - void recognize_page(std::string &image_name); void end_tesseract();