tesseract 4.1.1
|
#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 STRING &filename, FileWriter writer) const |
void | Serialize (GenericVector< 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 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 126 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 194 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 244 of file tessdatamanager.cpp.
void tesseract::TessdataManager::Directory | ( | ) | const |
Definition at line 202 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 295 of file tessdatamanager.cpp.
bool tesseract::TessdataManager::GetComponent | ( | TessdataType | type, |
TFile * | fp | ||
) |
Definition at line 216 of file tessdatamanager.cpp.
bool tesseract::TessdataManager::GetComponent | ( | TessdataType | type, |
TFile * | fp | ||
) | const |
Definition at line 224 of file tessdatamanager.cpp.
|
inline |
Definition at line 186 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 97 of file tessdatamanager.cpp.
|
inline |
Definition at line 134 of file tessdatamanager.h.
|
inline |
Definition at line 177 of file tessdatamanager.h.
|
inline |
Definition at line 161 of file tessdatamanager.h.
|
inline |
Definition at line 183 of file tessdatamanager.h.
void tesseract::TessdataManager::LoadFileLater | ( | const char * | data_file_name | ) |
Definition at line 55 of file tessdatamanager.cpp.
bool tesseract::TessdataManager::LoadMemBuffer | ( | const char * | name, |
const char * | data, | ||
int | size | ||
) |
Definition at line 111 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 275 of file tessdatamanager.cpp.
void tesseract::TessdataManager::OverwriteEntry | ( | TessdataType | type, |
const char * | data, | ||
int | size | ||
) |
Definition at line 145 of file tessdatamanager.cpp.
bool tesseract::TessdataManager::SaveFile | ( | const STRING & | filename, |
FileWriter | writer | ||
) | const |
Definition at line 153 of file tessdatamanager.cpp.
void tesseract::TessdataManager::Serialize | ( | GenericVector< char > * | data | ) | const |
Definition at line 166 of file tessdatamanager.cpp.
void tesseract::TessdataManager::SetVersionString | ( | const std::string & | v_str | ) |
Definition at line 239 of file tessdatamanager.cpp.
|
inline |
Definition at line 133 of file tessdatamanager.h.
std::string tesseract::TessdataManager::VersionString | ( | ) | const |
Definition at line 233 of file tessdatamanager.cpp.