20 #ifndef TESSERACT_CCUTIL_TESSDATAMANAGER_H_ 21 #define TESSERACT_CCUTIL_TESSDATAMANAGER_H_ 23 #include "genericvector.h" 25 static const char kTrainedDataSuffix[] =
"traineddata";
29 static const char kLangConfigFileSuffix[] =
"config";
30 static const char kUnicharsetFileSuffix[] =
"unicharset";
31 static const char kAmbigsFileSuffix[] =
"unicharambigs";
32 static const char kBuiltInTemplatesFileSuffix[] =
"inttemp";
33 static const char kBuiltInCutoffsFileSuffix[] =
"pffmtable";
34 static const char kNormProtoFileSuffix[] =
"normproto";
35 static const char kPuncDawgFileSuffix[] =
"punc-dawg";
36 static const char kSystemDawgFileSuffix[] =
"word-dawg";
37 static const char kNumberDawgFileSuffix[] =
"number-dawg";
38 static const char kFreqDawgFileSuffix[] =
"freq-dawg";
39 static const char kFixedLengthDawgsFileSuffix[] =
"fixed-length-dawgs";
40 static const char kCubeUnicharsetFileSuffix[] =
"cube-unicharset";
41 static const char kCubeSystemDawgFileSuffix[] =
"cube-word-dawg";
42 static const char kShapeTableFileSuffix[] =
"shapetable";
43 static const char kBigramDawgFileSuffix[] =
"bigram-dawg";
44 static const char kUnambigDawgFileSuffix[] =
"unambig-dawg";
45 static const char kParamsModelFileSuffix[] =
"params-model";
46 static const char kLSTMModelFileSuffix[] =
"lstm";
47 static const char kLSTMPuncDawgFileSuffix[] =
"lstm-punc-dawg";
48 static const char kLSTMSystemDawgFileSuffix[] =
"lstm-word-dawg";
49 static const char kLSTMNumberDawgFileSuffix[] =
"lstm-number-dawg";
50 static const char kLSTMUnicharsetFileSuffix[] =
"lstm-unicharset";
51 static const char kLSTMRecoderFileSuffix[] =
"lstm-recoder";
52 static const char kVersionFileSuffix[] =
"version";
90 kLangConfigFileSuffix,
91 kUnicharsetFileSuffix,
93 kBuiltInTemplatesFileSuffix,
94 kBuiltInCutoffsFileSuffix,
97 kSystemDawgFileSuffix,
98 kNumberDawgFileSuffix,
100 kFixedLengthDawgsFileSuffix,
101 kCubeUnicharsetFileSuffix,
102 kCubeSystemDawgFileSuffix,
103 kShapeTableFileSuffix,
104 kBigramDawgFileSuffix,
105 kUnambigDawgFileSuffix,
106 kParamsModelFileSuffix,
107 kLSTMModelFileSuffix,
108 kLSTMPuncDawgFileSuffix,
109 kLSTMSystemDawgFileSuffix,
110 kLSTMNumberDawgFileSuffix,
111 kLSTMUnicharsetFileSuffix,
112 kLSTMRecoderFileSuffix,
143 bool Init(
const char *data_file_name);
146 bool LoadMemBuffer(
const char *name,
const char *data,
int size);
194 const char *output_filename);
202 char **component_filenames,
203 int num_new_components);
248 #endif // TESSERACT_CCUTIL_TESSDATAMANAGER_H_ Definition: tessdatamanager.h:82
Definition: tessdatamanager.h:67
void OverwriteEntry(TessdataType type, const char *data, int size)
Definition: tessdatamanager.cpp:99
bool swap() const
Definition: tessdatamanager.h:133
static const char *const kTessdataFileSuffixes[]
Definition: tessdatamanager.h:89
Definition: tessdatamanager.h:70
Definition: tessdatamanager.h:77
bool OverwriteComponents(const char *new_traineddata_filename, char **component_filenames, int num_new_components)
Definition: tessdatamanager.cpp:227
bool Init(const char *data_file_name)
Definition: tessdatamanager.cpp:55
bool is_loaded_
Definition: tessdatamanager.h:239
void Directory() const
Definition: tessdatamanager.cpp:154
std::string VersionString() const
Definition: tessdatamanager.cpp:185
Definition: tessdatamanager.h:57
Definition: tessdatamanager.h:78
TessdataManager()
Definition: tessdatamanager.cpp:37
bool GetComponent(TessdataType type, TFile *fp)
Definition: tessdatamanager.cpp:168
bool(* FileReader)(const STRING &filename, GenericVector< char > *data)
Definition: genericvector.h:360
Definition: serialis.h:77
Definition: tessdatamanager.h:73
Definition: tessdatamanager.h:69
FileReader reader_
Definition: tessdatamanager.h:237
Definition: baseapi.cpp:94
bool IsComponentAvailable(TessdataType type) const
Definition: tessdatamanager.h:161
Definition: tessdatamanager.h:59
Definition: tessdatamanager.h:64
bool LoadMemBuffer(const char *name, const char *data, int size)
Definition: tessdatamanager.cpp:66
void Clear()
Definition: tessdatamanager.cpp:146
Definition: tessdatamanager.h:58
bool(* FileWriter)(const GenericVector< char > &data, const STRING &filename)
Definition: genericvector.h:363
Definition: tessdatamanager.h:80
STRING data_file_name_
Definition: tessdatamanager.h:235
GenericVector< char > entries_[TESSDATA_NUM_ENTRIES]
Definition: tessdatamanager.h:243
Definition: tessdatamanager.h:72
Definition: tessdatamanager.h:74
bool swap_
Definition: tessdatamanager.h:241
Definition: tessdatamanager.h:75
Definition: tessdatamanager.h:126
Definition: tessdatamanager.h:66
TessdataType
Definition: tessdatamanager.h:56
bool IsBaseAvailable() const
Definition: tessdatamanager.h:177
~TessdataManager()=default
void SetVersionString(const std::string &v_str)
Definition: tessdatamanager.cpp:191
void Serialize(GenericVector< char > *data) const
Definition: tessdatamanager.cpp:119
bool SaveFile(const STRING &filename, FileWriter writer) const
Definition: tessdatamanager.cpp:107
bool ExtractToFile(const char *filename)
Definition: tessdatamanager.cpp:246
Definition: tessdatamanager.h:61
const STRING & GetDataFileName() const
Definition: tessdatamanager.h:186
static bool TessdataTypeFromFileName(const char *filename, TessdataType *type)
Definition: tessdatamanager.cpp:267
Definition: tessdatamanager.h:62
Definition: tessdatamanager.h:68
bool is_loaded() const
Definition: tessdatamanager.h:134
Definition: tessdatamanager.h:63
Definition: tessdatamanager.h:71
Definition: tessdatamanager.h:76
Definition: tessdatamanager.h:79
static const int kMaxNumTessdataEntries
Definition: tessdatamanager.h:123
bool empty() const
Definition: genericvector.h:90
bool IsLSTMAvailable() const
Definition: tessdatamanager.h:183
Definition: tessdatamanager.h:60
static bool TessdataTypeFromFileSuffix(const char *suffix, TessdataType *type)
Definition: tessdatamanager.cpp:254
bool CombineDataFiles(const char *language_data_path_prefix, const char *output_filename)
Definition: tessdatamanager.cpp:196
void LoadFileLater(const char *data_file_name)
Definition: tessdatamanager.cpp:50
Definition: tessdatamanager.h:65