tesseract v5.3.3.20231005
|
#include <tessdatamanager.h>
Public Member Functions | |
TessdataManager () | |
TessdataManager (FileReader reader) | |
~TessdataManager ()=default | |
bool | swap () const |
bool | is_loaded () const |
void | LoadFileLater (const char *data_file_name) |
bool | Init (const char *data_file_name) |
bool | LoadMemBuffer (const char *name, const char *data, int size) |
void | OverwriteEntry (TessdataType type, const char *data, int size) |
bool | SaveFile (const char *filename, FileWriter writer) const |
void | Serialize (std::vector< char > *data) const |
void | Clear () |
void | Directory () const |
bool | IsComponentAvailable (TessdataType type) const |
bool | GetComponent (TessdataType type, TFile *fp) |
bool | GetComponent (TessdataType type, TFile *fp) const |
std::string | VersionString () const |
void | SetVersionString (const std::string &v_str) |
bool | IsBaseAvailable () const |
bool | IsLSTMAvailable () const |
const std::string & | GetDataFileName () const |
bool | CombineDataFiles (const char *language_data_path_prefix, const char *output_filename) |
bool | OverwriteComponents (const char *new_traineddata_filename, char **component_filenames, int num_new_components) |
bool | ExtractToFile (const char *filename) |
Definition at line 127 of file tessdatamanager.h.
tesseract::TessdataManager::TessdataManager | ( | ) |
Definition at line 42 of file tessdatamanager.cpp.
|
explicit |
Definition at line 46 of file tessdatamanager.cpp.
|
default |
void tesseract::TessdataManager::Clear | ( | ) |
Definition at line 205 of file tessdatamanager.cpp.
bool tesseract::TessdataManager::CombineDataFiles | ( | const char * | language_data_path_prefix, |
const char * | output_filename | ||
) |
Reads all the standard tesseract config and data files for a language at the given path and bundles them up into one binary data file. Returns true if the combined traineddata file was successfully written.
Definition at line 258 of file tessdatamanager.cpp.
void tesseract::TessdataManager::Directory | ( | ) | const |
Definition at line 213 of file tessdatamanager.cpp.
bool tesseract::TessdataManager::ExtractToFile | ( | const char * | filename | ) |
Extracts tessdata component implied by the name of the input file from the combined traineddata loaded into TessdataManager. Writes the extracted component to the file indicated by the file name. E.g. if the filename given is somepath/somelang.unicharset, unicharset will be extracted from the data loaded into the TessdataManager and will be written to somepath/somelang.unicharset.
Definition at line 306 of file tessdatamanager.cpp.
bool tesseract::TessdataManager::GetComponent | ( | TessdataType | type, |
TFile * | fp | ||
) |
Definition at line 227 of file tessdatamanager.cpp.
bool tesseract::TessdataManager::GetComponent | ( | TessdataType | type, |
TFile * | fp | ||
) | const |
Definition at line 237 of file tessdatamanager.cpp.
|
inline |
Definition at line 192 of file tessdatamanager.h.
bool tesseract::TessdataManager::Init | ( | const char * | data_file_name | ) |
Opens and reads the given data file right now.
Definition at line 90 of file tessdatamanager.cpp.
|
inline |
Definition at line 137 of file tessdatamanager.h.
|
inline |
Definition at line 182 of file tessdatamanager.h.
|
inline |
Definition at line 166 of file tessdatamanager.h.
|
inline |
Definition at line 187 of file tessdatamanager.h.
void tesseract::TessdataManager::LoadFileLater | ( | const char * | data_file_name | ) |
Definition at line 53 of file tessdatamanager.cpp.
bool tesseract::TessdataManager::LoadMemBuffer | ( | const char * | name, |
const char * | data, | ||
int | size | ||
) |
Definition at line 110 of file tessdatamanager.cpp.
bool tesseract::TessdataManager::OverwriteComponents | ( | const char * | new_traineddata_filename, |
char ** | component_filenames, | ||
int | num_new_components | ||
) |
Gets the individual components from the data_file_ with which the class was initialized. Overwrites the components specified by component_filenames. Writes the updated traineddata file to new_traineddata_filename.
Definition at line 288 of file tessdatamanager.cpp.
void tesseract::TessdataManager::OverwriteEntry | ( | TessdataType | type, |
const char * | data, | ||
int | size | ||
) |
Definition at line 157 of file tessdatamanager.cpp.
bool tesseract::TessdataManager::SaveFile | ( | const char * | filename, |
FileWriter | writer | ||
) | const |
Definition at line 164 of file tessdatamanager.cpp.
void tesseract::TessdataManager::Serialize | ( | std::vector< char > * | data | ) | const |
Definition at line 177 of file tessdatamanager.cpp.
void tesseract::TessdataManager::SetVersionString | ( | const std::string & | v_str | ) |
Definition at line 253 of file tessdatamanager.cpp.
|
inline |
Definition at line 134 of file tessdatamanager.h.
std::string tesseract::TessdataManager::VersionString | ( | ) | const |
Definition at line 248 of file tessdatamanager.cpp.