|
tesseract
3.05.01
|
#include "featdefs.h"#include "emalloc.h"#include "danerror.h"#include "scanutils.h"#include <string.h>#include <stdio.h>Go to the source code of this file.
Macros | |
| #define | ILLEGAL_NUM_SETS 3001 |
| #define | PICO_FEATURE_LENGTH 0.05 |
Functions | |
| void | InitFeatureDefs (FEATURE_DEFS_STRUCT *featuredefs) |
| void | FreeCharDescription (CHAR_DESC CharDesc) |
| CHAR_DESC | NewCharDescription (const FEATURE_DEFS_STRUCT &FeatureDefs) |
| void | WriteCharDescription (const FEATURE_DEFS_STRUCT &FeatureDefs, CHAR_DESC CharDesc, STRING *str) |
| bool | ValidCharDescription (const FEATURE_DEFS_STRUCT &FeatureDefs, CHAR_DESC CharDesc) |
| CHAR_DESC | ReadCharDescription (const FEATURE_DEFS_STRUCT &FeatureDefs, FILE *File) |
| int | ShortNameToFeatureType (const FEATURE_DEFS_STRUCT &FeatureDefs, const char *ShortName) |
Variables | |
| const char * | kMicroFeatureType = "mf" |
| const char * | kCNFeatureType = "cn" |
| const char * | kIntFeatureType = "if" |
| const char * | kGeoFeatureType = "tb" |
| EndParamDesc EndParamDesc EndParamDesc EndParamDesc FLOAT32 | PicoFeatureLength = PICO_FEATURE_LENGTH |
| #define ILLEGAL_NUM_SETS 3001 |
define errors triggered by this module
Definition at line 34 of file featdefs.cpp.
| #define PICO_FEATURE_LENGTH 0.05 |
Definition at line 36 of file featdefs.cpp.
| void FreeCharDescription | ( | CHAR_DESC | CharDesc | ) |
Release the memory consumed by the specified character description and all of the features in that description.
| CharDesc | character description to be deallocated |
Globals:
Definition at line 141 of file featdefs.cpp.
| void InitFeatureDefs | ( | FEATURE_DEFS_STRUCT * | featuredefs | ) |
Definition at line 121 of file featdefs.cpp.
| CHAR_DESC NewCharDescription | ( | const FEATURE_DEFS_STRUCT & | FeatureDefs | ) |
Allocate a new character description, initialize its feature sets to be empty, and return it.
Globals:
Definition at line 164 of file featdefs.cpp.
| CHAR_DESC ReadCharDescription | ( | const FEATURE_DEFS_STRUCT & | FeatureDefs, |
| FILE * | File | ||
| ) |
Read a character description from File, and return a data structure containing this information. The data is formatted as follows:
NumberOfSets
ShortNameForSet1 Set1
ShortNameForSet2 Set2
...
Globals:
| FeatureDefs | definitions of feature types/extractors |
| File | open text file to read character description from |
Definition at line 263 of file featdefs.cpp.
| int ShortNameToFeatureType | ( | const FEATURE_DEFS_STRUCT & | FeatureDefs, |
| const char * | ShortName | ||
| ) |
Search through all features currently defined and return the feature type for the feature with the specified short name. Trap an error if the specified name is not found.
Globals:
| FeatureDefs | definitions of feature types/extractors |
| ShortName | short name of a feature type |
Definition at line 302 of file featdefs.cpp.
| bool ValidCharDescription | ( | const FEATURE_DEFS_STRUCT & | FeatureDefs, |
| CHAR_DESC | CharDesc | ||
| ) |
Definition at line 219 of file featdefs.cpp.
| void WriteCharDescription | ( | const FEATURE_DEFS_STRUCT & | FeatureDefs, |
| CHAR_DESC | CharDesc, | ||
| STRING * | str | ||
| ) |
Appends a textual representation of CharDesc to str. The format used is to write out the number of feature sets which will be written followed by a representation of each feature set.
Each set starts with the short name for that feature followed by a description of the feature set. Feature sets which are not present are not written.
| FeatureDefs | definitions of feature types/extractors |
| str | string to append CharDesc to |
| CharDesc | character description to write to File |
Definition at line 197 of file featdefs.cpp.
| const char* kCNFeatureType = "cn" |
Definition at line 42 of file featdefs.cpp.
| const char* kGeoFeatureType = "tb" |
Definition at line 44 of file featdefs.cpp.
| const char* kIntFeatureType = "if" |
Definition at line 43 of file featdefs.cpp.
| const char* kMicroFeatureType = "mf" |
Definition at line 41 of file featdefs.cpp.
| EndParamDesc EndParamDesc EndParamDesc EndParamDesc FLOAT32 PicoFeatureLength = PICO_FEATURE_LENGTH |