This program reads in a text file consisting of feature samples from a training page in the following format:
The result of this program is a binary inttemp file used by the OCR engine.
214 tesseract::CheckSharedLibraryVersion();
225 if (trainer ==
nullptr)
return 1;
232 SetupConfigMap(shape_table, &config_map);
244 unicharset = &shape_set;
248 for (
int s = 0; s < num_shapes; ++s) {
256 int num_configs = shape_table->
NumShapes();
258 for (
int s = 0; s < num_configs; ++s) {
259 int unichar_id, font_id;
260 if (unicharset == &shape_set) {
267 const char* class_label = unicharset->
id_to_unichar(unichar_id);
268 mf_classes = ClusterOneConfig(s, class_label, mf_classes, *shape_table,
271 STRING inttemp_file = file_prefix;
272 inttemp_file +=
"inttemp";
273 STRING pffmtable_file = file_prefix;
274 pffmtable_file +=
"pffmtable";
278 *shape_table, float_classes,
281 for (
int c = 0; c < unicharset->
size(); ++c) {
284 delete [] float_classes;
289 if (!FLAGS_test_ch.empty()) {
291 printf(
"Hit return to exit...\n");
292 while (getchar() !=
'\n');
void FreeClassFields(CLASS_TYPE Class)
const UNICHARSET & unicharset() const
const char * string() const
void ParseArguments(int *argc, char ***argv)
bool AnyMultipleUnichars() const
void unichar_insert(const char *const unichar_repr, OldUncleanUnichars old_style)
void WriteShapeTable(const STRING &file_prefix, const ShapeTable &shape_table)
void FreeLabeledClassList(LIST ClassList)
const char * id_to_unichar(UNICHAR_ID id) const
void GetFirstUnicharAndFont(int shape_id, int *unichar_id, int *font_id) const
virtual int SparseToCompact(int sparse_index) const
CLASS_STRUCT * SetUpForFloat2Int(const UNICHARSET &unicharset, LIST LabeledClassList)
MasterTrainer * LoadTrainingData(int argc, const char *const *argv, bool replication, ShapeTable **shape_table, STRING *file_prefix)
const int kMaxShapeLabelLength
void WriteInttempAndPFFMTable(const UNICHARSET &unicharset, const UNICHARSET &shape_set, const ShapeTable &shape_table, CLASS_STRUCT *float_classes, const char *inttemp_file, const char *pffmtable_file)