ccstruct/ratngs.h File Reference

#include "clst.h"
#include "werd.h"
#include "notdll.h"

Go to the source code of this file.

Classes

Defines

Typedefs

Functions

Variables


Define Documentation

#define COMPOUND_PERM   9

Referenced by permute_compound_words().

#define DOC_DAWG_PERM   6

Referenced by permute_words(), tilde_crunch(), and valid_word().

#define FREQ_DAWG_PERM   8

Referenced by adjust_word(), dict_word(), fixspace_thinks_word_done(), fp_eval_word_spacing(), garbage_word(), recog_all_words(), recog_word(), and word_adaptable().

#define LOWER_CASE_PERM   2

Referenced by permute_top_choice().

#define MAX_PERM   9

#define MIN_PERM   1

#define NO_PERM   0

Referenced by append_choice(), make_epaper_choice(), number_permute_and_select(), permute_compound_words(), permute_words(), valid_word(), and write_results().

#define NUMBER_PERM   4

Referenced by append_number_choices(), digit_or_numeric_punct(), eval_word_spacing(), fixspace_thinks_word_done(), garbage_word(), and word_adaptable().

#define SYSTEM_DAWG_PERM   5

Referenced by fixspace_thinks_word_done(), fp_eval_word_spacing(), garbage_word(), permute_words(), recog_all_words(), recog_word(), valid_word(), and word_adaptable().

#define TOP_CHOICE_PERM   1

Referenced by permute_top_choice(), and recog_word().

#define UPPER_CASE_PERM   3

Referenced by permute_top_choice().

#define USER_DAWG_PERM   7

Referenced by fixspace_thinks_word_done(), fp_eval_word_spacing(), garbage_word(), permute_words(), recog_all_words(), recog_word(), valid_word(), and word_adaptable().


Typedef Documentation

typedef void(*) POLY_MATCHER(PBLOB *, PBLOB *, PBLOB *, WERD *, DENORM *, BLOB_CHOICE_LIST &)

Definition at line 150 of file ratngs.h.

typedef void(*) POLY_TESTER(PBLOB *, DENORM *, BOOL8, char *, INT32, BLOB_CHOICE_LIST *)

Definition at line 152 of file ratngs.h.


Function Documentation

CLISTIZEH ( WERD_CHOICE   )  const

void print_ratings_info ( FILE *  fp,
BLOB_CHOICE_LIST *  ratings 
)

Send all the ratings out to the logfile.

Definition at line 186 of file ratngs.cpp.

References blob_answer, INT32FORMAT, and matcher_fp.

00189                          {
00190   INT32
00191     index;                       //to list
00192   INT32
00193     best_index;                  //to list
00194   FLOAT32
00195     best_rat;                    //rating
00196   FLOAT32
00197     best_cert;                   //certainty
00198   char
00199     first_char;                  //character
00200   FLOAT32
00201     first_rat;                   //rating
00202   FLOAT32
00203     first_cert;                  //certainty
00204   char
00205     sec_char = 0;                //character
00206   FLOAT32
00207     sec_rat = 0.0f;              //rating
00208   FLOAT32
00209     sec_cert = 0.0f;             //certainty
00210   BLOB_CHOICE_IT
00211     c_it = ratings;              //iterator
00212 
00213   index = ratings->length ();
00214   if (index > 0) {
00215     first_char = c_it.data ()->char_class ();
00216     first_rat = c_it.data ()->rating ();
00217     first_cert = -c_it.data ()->certainty ();
00218     if (index > 1) {
00219       sec_char = c_it.data_relative (1)->char_class ();
00220       sec_rat = c_it.data_relative (1)->rating ();
00221       sec_cert = -c_it.data_relative (1)->certainty ();
00222     }
00223     else {
00224       sec_char = '~';
00225       sec_rat = -1;
00226       sec_cert = -1;
00227     }
00228   }
00229   else {
00230     first_char = '~';
00231     first_rat = -1;
00232     first_cert = -1;
00233   }
00234   best_index = -1;
00235   best_rat = -1;
00236   best_cert = -1;
00237   for (index = 0, c_it.mark_cycle_pt (); !c_it.cycled_list ();
00238   c_it.forward (), index++) {
00239     if (c_it.data ()->char_class () == blob_answer) {
00240       best_index = index;
00241       best_rat = c_it.data ()->rating ();
00242       best_cert = -c_it.data ()->certainty ();
00243     }
00244   }
00245   if (first_char == '\0' || first_char == ' ')
00246     first_char = '~';
00247   if (sec_char == '\0' || sec_char == ' ')
00248     sec_char = '~';
00249   fprintf (matcher_fp,
00250     " " INT32FORMAT " " INT32FORMAT " %g %g %c %g %g %c %g %g\n",
00251     ratings->length (), best_index, best_rat, best_cert, first_char,
00252     first_rat, first_cert, sec_char, sec_rat, sec_cert);
00253 }


Variable Documentation

BLOB_CHOICE_LIST* ratings

Definition at line 145 of file ratngs.h.

Referenced by call_matcher(), call_tester(), call_train_tester(), chop_word_main(), get_piece_rating(), put_match(), rating_priority(), and record_piece_ratings().


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