classify/flexfx.cpp File Reference

#include "flexfx.h"
#include "featdefs.h"
#include "variables.h"
#include "sigmenu.h"
#include "emalloc.h"
#include <string.h>
#include <stdio.h>

Go to the source code of this file.

Defines

Functions


Define Documentation

#define NamePrefix   "Enable"

#define NameSuffix   "Features"


Function Documentation

CHAR_DESC ExtractFlexFeatures ( TBLOB Blob,
LINE_STATS LineStats 
)

Allocate a new character descriptor and fill it in by calling all feature extractors which are enabled.

Parameters:
Blob Blob to extract features from
LineStats Statistics about text line Blob is on
Returns:
Structure containing features extracted from Blob.
Note:
Exceptions: none
Date:
Wed May 23 13:46:22 1990, DSJ, Created.

Definition at line 44 of file flexfx.cpp.

References ExtractorOf, ExtractUsing, FeaturesOfType, NewCharDescription(), NULL, and NumFeatureSetsIn.

Referenced by ExtractBlobFeatures().

00044                                                                   { 
00045   int Type;
00046   CHAR_DESC CharDesc;
00047 
00048   CharDesc = NewCharDescription ();
00049 
00050   for (Type = 0; Type < NumFeatureSetsIn(CharDesc); Type++)
00051     if (ExtractorOf(Type) != NULL && ExtractorOf(Type)->Extractor != NULL)
00052       FeaturesOfType(CharDesc, Type) =
00053         ExtractUsing(ExtractorOf(Type)) (Blob, LineStats);
00054 
00055   return (CharDesc);
00056 
00057 }                                /* ExtractFlexFeatures */

void InitFlexFXVars (  ) 

Add any control variables used by the feature extractors to the variable system; including the enable flag for each individual extractor.

Parameters:
none 
Returns:
none
This routine needs to create a separate name for the enable for each feature extractor and allocate a string to contain that name. This is necessary since the "variables" routines do not create copies of the string names passed to them.
Note:
Exceptions: none
Date:
Wed May 23 15:59:23 1990, DSJ, Created.

Definition at line 75 of file flexfx.cpp.

References ExtractorOf, InitFXVarsUsing, NumFeaturesDefined, and SetupExtractors().

Referenced by InitExtractorVars().

00078 {
00079   int Type;
00080 
00081   SetupExtractors();
00082   for (Type = 0; Type < NumFeaturesDefined (); Type++) {
00083     InitFXVarsUsing (ExtractorOf (Type)) ();
00084   }
00085 }                                /* InitFlexFXVars */


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