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() {
00035 }
00036 BLOB_CHOICE(
00037 char src_class,
00038 float src_rating,
00039 float src_cert,
00040 INT8 src_config);
00041
00042 void set_class(
00043 char newchar) {
00044 blob_class = newchar;
00045 }
00046 void set_rating(
00047 float newrat) {
00048 blob_rating = newrat;
00049 }
00050 void set_certainty(
00051 float newrat) {
00052 blob_certainty = newrat;
00053 }
00054 void set_config(
00055 INT8 newfont) {
00056 blob_config = newfont;
00057 }
00058
00059 char char_class() const {
00060 return blob_class;
00061 }
00062 float rating() const {
00063 return blob_rating;
00064 }
00065 float certainty() const {
00066 return blob_certainty;
00067 }
00068 INT8 config() const {
00069 return blob_config;
00070 }
00071
00072 NEWDELETE private:
00073 char blob_class;
00074 char blob_config;
00075 INT16 junk2;
00076 float blob_rating;
00077 float blob_certainty;
00078 };
00079
00080
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() {
00105 }
00106 WERD_CHOICE(
00107 const char *src_string,
00108 float src_rating,
00109 float src_cert,
00110 UINT8 src_permuter);
00111
00112
00113 const STRING &string() const {
00114 return word_string;
00115 }
00116
00117 float rating() const {
00118 return word_rating;
00119 }
00120 float certainty() const {
00121 return word_certainty;
00122 }
00123 UINT8 permuter() const {
00124 return word_permuter;
00125 }
00126 void set_permuter(
00127 UINT8 perm) {
00128 word_permuter = perm;
00129 }
00130
00131 WERD_CHOICE & operator+= (
00132 const WERD_CHOICE & second);
00133
00134 NEWDELETE private:
00135 STRING word_string;
00136 float word_rating;
00137 float word_certainty;
00138 UINT8 word_permuter;
00139 };
00140
00141 CLISTIZEH (WERD_CHOICE)
00142 void print_ratings_list(
00143 const char *msg,
00144 BLOB_CHOICE_LIST *ratings
00145 );
00146 void print_ratings_info(
00147 FILE *fp,
00148 BLOB_CHOICE_LIST *ratings
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