ccstruct/ratngs.h

Go to the documentation of this file.
00001 
00020 #ifndef           RATNGS_H
00021 #define           RATNGS_H
00022 
00023 #include          "clst.h"
00024 #include          "werd.h"
00025 #include          "notdll.h"
00026 
00031 class BLOB_CHOICE:public ELIST_LINK
00032 {
00033   public:
00034     BLOB_CHOICE() {  //empty
00035     }
00036     BLOB_CHOICE(                   //constructor
00037                 char src_class,    //character
00038                 float src_rating,  //rating
00039                 float src_cert,    //certainty
00040                 INT8 src_config);  //config (font)
00041 
00042     void set_class(  //change it
00043                    char newchar) {
00044       blob_class = newchar;
00045     }
00046     void set_rating(  //change it
00047                     float newrat) {
00048       blob_rating = newrat;
00049     }
00050     void set_certainty(  //change it
00051                        float newrat) {
00052       blob_certainty = newrat;
00053     }
00054     void set_config(  //change it
00055                     INT8 newfont) {
00056       blob_config = newfont;
00057     }
00058 
00059     char char_class() const {  //access function
00060       return blob_class;
00061     }
00062     float rating() const {  //access function
00063       return blob_rating;
00064     }
00065     float certainty() const {  //access function
00066       return blob_certainty;
00067     }
00068     INT8 config() const {  //access function
00069       return blob_config;
00070     }
00071 
00072     NEWDELETE private:
00073     char blob_class;             //char code
00074     char blob_config;            //char config (font)
00075     INT16 junk2;
00076     float blob_rating;           //size related
00077     float blob_certainty;        //absolute
00078 };
00079 
00080                                  //make them listable
00081 ELISTIZEH (BLOB_CHOICE) CLISTIZEH (BLOB_CHOICE_LIST)
00084 #define MIN_PERM      1
00085 #define NO_PERM       0
00086 #define TOP_CHOICE_PERM  1
00087 #define LOWER_CASE_PERM  2
00088 #define UPPER_CASE_PERM  3
00089 #define NUMBER_PERM      4
00090 #define SYSTEM_DAWG_PERM 5
00091 #define DOC_DAWG_PERM    6
00092 #define USER_DAWG_PERM   7
00093 #define FREQ_DAWG_PERM   8
00094 #define COMPOUND_PERM    9
00095 #define MAX_PERM      9
00096 
00101 class WERD_CHOICE
00102 {
00103   public:
00104     WERD_CHOICE() {  //empty
00105     }
00106     WERD_CHOICE(                         //constructor
00107                 const char *src_string,  //word string
00108                 float src_rating,        //rating
00109                 float src_cert,          //certainty
00110                 UINT8 src_permuter);     //permuter code
00111 
00112                                  //access function
00113     const STRING &string() const { 
00114       return word_string;
00115     }
00116 
00117     float rating() const {  //access function
00118       return word_rating;
00119     }
00120     float certainty() const {  //access function
00121       return word_certainty;
00122     }
00123     UINT8 permuter() const {  //access function
00124       return word_permuter;
00125     }
00126     void set_permuter(  //Override
00127                       UINT8 perm) {
00128       word_permuter = perm;
00129     }
00130 
00131     WERD_CHOICE & operator+= (   //concatanate
00132       const WERD_CHOICE & second);//second on first
00133 
00134     NEWDELETE private:
00135     STRING word_string;          //text
00136     float word_rating;           //size related
00137     float word_certainty;        //absolute
00138     UINT8 word_permuter;         //permuter code
00139 };
00140 
00141 CLISTIZEH (WERD_CHOICE)
00142 void print_ratings_list(                           //print whole list
00143                         const char *msg,           //intro message
00144                         BLOB_CHOICE_LIST *ratings  //list of results
00145                        );
00146 void print_ratings_info(                           //print summary info
00147                         FILE *fp,                  //file to use
00148                         BLOB_CHOICE_LIST *ratings  //list of results
00149                        );
00150 typedef void (*POLY_MATCHER) (PBLOB *, PBLOB *, PBLOB *, WERD *,
00151 DENORM *, BLOB_CHOICE_LIST &);
00152 typedef void (*POLY_TESTER) (PBLOB *, DENORM *, BOOL8, char *, INT32,
00153 BLOB_CHOICE_LIST *);
00154 #endif

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