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.
259 SetupConfigMap(shape_table, &config_map);
271 unicharset = &shape_set;
275 for (
int s = 0; s < num_shapes; ++s) {
283 int num_configs = shape_table->
NumShapes();
285 for (
int s = 0; s < num_configs; ++s) {
286 int unichar_id, font_id;
287 if (unicharset == &shape_set) {
294 const char* class_label = unicharset->
id_to_unichar(unichar_id);
295 mf_classes = ClusterOneConfig(s, class_label, mf_classes, *shape_table,
298 STRING inttemp_file = file_prefix;
299 inttemp_file +=
"inttemp";
300 STRING pffmtable_file = file_prefix;
301 pffmtable_file +=
"pffmtable";
305 *shape_table, float_classes,
308 delete [] float_classes;
313 if (!FLAGS_test_ch.empty()) {
315 printf(
"Hit return to exit...\n");
316 while (getchar() !=
'\n');
void FreeLabeledClassList(LIST ClassList)
const char *const id_to_unichar(UNICHAR_ID id) const
virtual int SparseToCompact(int sparse_index) const
void ParseArguments(int *argc, char ***argv)
const UNICHARSET & unicharset() const
void unichar_insert(const char *const unichar_repr)
const int kMaxShapeLabelLength
MasterTrainer * LoadTrainingData(int argc, const char *const *argv, bool replication, ShapeTable **shape_table, STRING *file_prefix)
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)
CLASS_STRUCT * SetUpForFloat2Int(const UNICHARSET &unicharset, LIST LabeledClassList)
bool AnyMultipleUnichars() const
void GetFirstUnicharAndFont(int shape_id, int *unichar_id, int *font_id) const
const char * string() const
void WriteShapeTable(const STRING &file_prefix, const ShapeTable &shape_table)