Merge pull request #3609 from stweil/api

Remove TessBaseAPI::InitLangMod (API change)
This commit is contained in:
zdenop 2021-10-26 07:23:52 +02:00 committed by GitHub
commit 48c5d426ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 0 additions and 51 deletions

View File

@ -247,14 +247,6 @@ public:
*/
void GetAvailableLanguagesAsVector(std::vector<std::string> *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.

View File

@ -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,

View File

@ -474,25 +474,6 @@ void TessBaseAPI::GetAvailableLanguagesAsVector(std::vector<std::string> *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.

View File

@ -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();
}

View File

@ -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() {

View File

@ -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();