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.
256 SetupConfigMap(shape_table, &config_map);
268 unicharset = &shape_set;
272 for (
int s = 0; s < num_shapes; ++s) {
280 int num_configs = shape_table->
NumShapes();
282 for (
int s = 0; s < num_configs; ++s) {
283 int unichar_id, font_id;
284 if (unicharset == &shape_set) {
291 const char* class_label = unicharset->
id_to_unichar(unichar_id);
292 mf_classes = ClusterOneConfig(s, class_label, mf_classes, *shape_table,
295 STRING inttemp_file = file_prefix;
296 inttemp_file +=
"inttemp";
297 STRING pffmtable_file = file_prefix;
298 pffmtable_file +=
"pffmtable";
302 *shape_table, float_classes,
305 for (
int c = 0; c < unicharset->
size(); ++c) {
308 delete [] float_classes;
313 if (!FLAGS_test_ch.empty()) {
315 printf(
"Hit return to exit...\n");
316 while (getchar() !=
'\n');
virtual int SparseToCompact(int sparse_index) const
CLASS_STRUCT * SetUpForFloat2Int(const UNICHARSET &unicharset, LIST LabeledClassList)
void FreeClassFields(CLASS_TYPE Class)
void ParseArguments(int *argc, char ***argv)
const int kMaxShapeLabelLength
const char * string() const
MasterTrainer * LoadTrainingData(int argc, const char *const *argv, bool replication, ShapeTable **shape_table, STRING *file_prefix)
void WriteShapeTable(const STRING &file_prefix, const ShapeTable &shape_table)
bool AnyMultipleUnichars() const
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)
void TESS_API unichar_insert(const char *const unichar_repr)
void GetFirstUnicharAndFont(int shape_id, int *unichar_id, int *font_id) const
void FreeLabeledClassList(LIST ClassList)
const char * id_to_unichar(UNICHAR_ID id) const
const UNICHARSET & unicharset() const