dict/stopper.h

Go to the documentation of this file.
00001 
00019 #ifndef   STOPPER_H
00020 #define   STOPPER_H
00021 
00022 /* =================
00023           Include Files and Type Defines
00024  ==================== */
00025 #include "choicearr.h"
00026 #include "states.h"
00027 
00041 typedef UINT8 BLOB_WIDTH;
00042 
00050 typedef struct
00051 {
00052   INT16 index;
00053   unsigned bad_length:8;
00054   unsigned good_length:8;
00055 } DANGERR;
00056 
00057 /*---------------------------------------------------------------------------
00058           Variables
00059 ---------------------------------------------------------------------------*/
00065 extern float CertaintyPerChar;
00067 extern float NonDictCertainty;
00069 extern float RejectCertaintyOffset;
00071 extern int StopperDebugLevel;
00072 
00073 /* =================
00074             Macros
00075  ==================== */
00076 #define DisableChoiceAccum()  (KeepWordChoices = FALSE)
00077 #define EnableChoiceAccum() (KeepWordChoices = TRUE)
00078 
00079 /* =================
00080           Public Function Prototypes
00081  ==================== */
00082 int AcceptableChoice(CHOICES_LIST Choices,
00083                      A_CHOICE *BestChoice,
00084                      A_CHOICE *RawChoice,
00085                      DANGERR *fixpt);
00086 
00087 int AcceptableResult(A_CHOICE *BestChoice, A_CHOICE *RawChoice);
00088 
00089 int AlternativeChoicesWorseThan(FLOAT32 Threshold);
00090 
00091 int CurrentBestChoiceIs(const char *Word);
00092 
00093 FLOAT32 CurrentBestChoiceAdjustFactor();
00094 
00095 int CurrentWordAmbig();
00096 
00097 void DebugWordChoices();
00098 
00099 void FilterWordChoices();
00100 
00101 void FindClassifierErrors (FLOAT32 MinRating,
00102 FLOAT32 MaxRating,
00103 FLOAT32 RatingMargin, FLOAT32 Thresholds[]);
00104 
00105 void InitStopperVars();
00106 
00107 void InitChoiceAccum();
00108 
00109 void LogNewRawChoice (A_CHOICE * Choice,
00110 FLOAT32 AdjustFactor, float Certainties[]);
00111 
00112 void LogNewSegmentation(PIECES_STATE BlobWidth);
00113 
00114 void LogNewSplit(int Blob);
00115 
00116 void LogNewWordChoice (A_CHOICE * Choice,
00117 FLOAT32 AdjustFactor, float Certainties[]);
00118 
00119 int NoDangerousAmbig(const char *Word, DANGERR *fixpt);
00120 void EndDangerousAmbigs();
00121 
00122 void SettupStopperPass1();
00123 
00124 void SettupStopperPass2();
00125 
00126 /* =================
00127         Global Data Definitions and Declarations
00128  ==================== */
00129 extern BOOL8 KeepWordChoices;
00130 #endif

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