mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-01-20 15:59:11 +08:00
Merge pull request #3609 from stweil/api
Remove TessBaseAPI::InitLangMod (API change)
This commit is contained in:
commit
48c5d426ca
@ -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.
|
||||
|
@ -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,
|
||||
|
@ -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.
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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() {
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user