classify/cutoffs.h File Reference

#include "matchdefs.h"

Go to the source code of this file.

Typedefs

Functions


Typedef Documentation

CLASS_CUTOFF_ARRAY

FIX: Holds array of expected number of features for each class/character

Definition at line 32 of file cutoffs.h.


Function Documentation

void ReadNewCutoffs ( char *  Filename,
CLASS_TO_INDEX  ClassMapper,
CLASS_CUTOFF_ARRAY  Cutoffs 
)

Open Filename, read in all of the class-id/cutoff pairs and insert them into the Cutoffs array.

Parameters:
Filename Name of file containing cutoff definitions
ClassMapper Array which maps class id's to class indexes
Cutoffs Array to put cutoffs into
Returns:
none
Cutoffs are inserted in the array so that the array is indexed by class index rather than class id. Unused entries in the array are set to an arbitrarily high cutoff value.
Note:
Exceptions: none
Date:
Wed Feb 20 09:38:26 1991, DSJ, Created.

Definition at line 48 of file cutoffs.cpp.

References Efopen(), fscanf(), MAX_CUTOFF, and MAX_NUM_CLASSES.

Referenced by InitAdaptiveClassifier().

00050                                                 {
00051   FILE *CutoffFile;
00052   char Class[2];
00053   CLASS_ID ClassId;
00054   int Cutoff;
00055   int i;
00056 
00057   CutoffFile = Efopen (Filename, "r");
00058 
00059   for (i = 0; i < MAX_NUM_CLASSES; i++)
00060     Cutoffs[i] = MAX_CUTOFF;
00061 
00062   while (fscanf (CutoffFile, "%1s %d", Class, &Cutoff) == 2) {
00063     ClassId = Class[0];
00064     Cutoffs[ClassMapper[ClassId]] = Cutoff;
00065   }
00066   fclose(CutoffFile); 
00067 
00068 }                                /* ReadNewCutoffs */


Generated on Wed Feb 28 19:49:19 2007 for Tesseract by  doxygen 1.5.1