#include "featdefs.h"
#include "oldlist.h"
#include "blobs.h"
Go to the source code of this file.
| #define DisableCharDisplay |
( |
| ) |
(DisplayCharacters = FALSE) |
| #define DisableMatchDisplay |
( |
| ) |
(DisplayMatchList = FALSE) |
| #define EnableCharDisplay |
( |
| ) |
(DisplayCharacters = TRUE) |
Include Files and Type Defines
Definition at line 32 of file blobclass.h.
| #define EnableMatchDisplay |
( |
| ) |
(DisplayMatchList = TRUE) |
Public Function Prototypes
Public Code
Definition at line 52 of file blobclass.cpp.
71 #define TRAIN_SUFFIX ".tr"
72 static FILE *FeatureFile =
NULL;
77 if (CurrFontName == kUnknownFontName) {
80 const char *basename = strrchr(filename.
string(),
'/');
81 const char *firstdot = strchr(basename ? basename : filename.
string(),
'.');
82 const char *lastdot = strrchr(filename.
string(),
'.');
83 if (firstdot != lastdot && firstdot !=
NULL && lastdot !=
NULL) {
85 CurrFontName = firstdot;
86 CurrFontName[lastdot - firstdot] =
'\0';
92 if (FeatureFile ==
NULL) {
94 FeatureFile =
Efopen(Filename.string(),
"wb");
95 cprintf(
"TRAINING ... Font name = %s\n", CurrFontName.
string());
98 LearnBlob(FeatureDefs, FeatureFile, Blob, denorm, BlobText,
FILE * Efopen(const char *Name, const char *Mode)
const char * string() const
char * classify_font_name
void LearnBlob(const FEATURE_DEFS_STRUCT &FeatureDefs, const STRING &filename, TBLOB *Blob, const DENORM &denorm, const char *BlobText)
void cprintf(const char *format,...)
| void LearnBlob |
( |
const FEATURE_DEFS_STRUCT & |
FeatureDefs, |
|
|
FILE * |
File, |
|
|
TBLOB * |
Blob, |
|
|
const DENORM & |
denorm, |
|
|
const char * |
BlobText, |
|
|
const char * |
FontName |
|
) |
| |
Definition at line 102 of file blobclass.cpp.
110 if (CharDesc ==
NULL) {
111 cprintf(
"LearnBLob: CharDesc was NULL. Aborting.\n");
117 fprintf(FeatureFile,
"\n%s %s\n", FontName, BlobText);
122 tprintf(
"Blob learned was invalid!\n");
bool ValidCharDescription(const FEATURE_DEFS_STRUCT &FeatureDefs, CHAR_DESC CharDesc)
void FreeCharDescription(CHAR_DESC CharDesc)
DLLSYM void tprintf(const char *format,...)
void cprintf(const char *format,...)
void WriteCharDescription(const FEATURE_DEFS_STRUCT &FeatureDefs, FILE *File, CHAR_DESC CharDesc)