Tesseract  3.02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ROW_RES Class Reference

#include <pageres.h>

Inheritance diagram for ROW_RES:
ELIST_LINK

Public Member Functions

 ROW_RES ()
 
 ROW_RES (ROW *the_row)
 
 ~ROW_RES ()
 
- Public Member Functions inherited from ELIST_LINK
 ELIST_LINK ()
 
 ELIST_LINK (const ELIST_LINK &)
 
void operator= (const ELIST_LINK &)
 

Public Attributes

ROWrow
 
inT32 char_count
 
inT32 rej_count
 
inT32 whole_word_rej_count
 
WERD_RES_LIST word_res_list
 

Detailed Description

Definition at line 284 of file pageres.h.

Constructor & Destructor Documentation

ROW_RES::ROW_RES ( )
inline

Definition at line 292 of file pageres.h.

292  {
293  } // empty constructor
ROW_RES::ROW_RES ( ROW the_row)

Definition at line 137 of file pageres.cpp.

137  {
138  WERD_IT word_it(the_row->word_list());
139  WERD_RES_IT word_res_it(&word_res_list);
140  WERD_RES *combo = NULL; // current combination of fuzzies
141  WERD_RES *word_res; // current word
142  WERD *copy_word;
143 
144  char_count = 0;
145  rej_count = 0;
147 
148  row = the_row;
149  for (word_it.mark_cycle_pt(); !word_it.cycled_list(); word_it.forward()) {
150  word_res = new WERD_RES(word_it.data());
151  word_res->x_height = the_row->x_height();
152 
153  if (word_res->word->flag(W_FUZZY_NON)) {
154  ASSERT_HOST(combo != NULL);
155  word_res->part_of_combo = TRUE;
156  combo->copy_on(word_res);
157  }
158  if (word_it.data_relative(1)->flag(W_FUZZY_NON)) {
159  if (combo == NULL) {
160  copy_word = new WERD;
161  //deep copy
162  *copy_word = *(word_it.data());
163  combo = new WERD_RES(copy_word);
164  combo->x_height = the_row->x_height();
165  combo->combination = TRUE;
166  word_res_it.add_to_end(combo);
167  }
168  word_res->part_of_combo = TRUE;
169  } else {
170  combo = NULL;
171  }
172  word_res_it.add_to_end(word_res);
173  }
174 }
BOOL8 part_of_combo
Definition: pageres.h:451
#define NULL
Definition: host.h:144
BOOL8 combination
Definition: pageres.h:450
WERD_RES_LIST word_res_list
Definition: pageres.h:290
BOOL8 flag(WERD_FLAGS mask) const
Definition: werd.h:122
WERD * word
Definition: pageres.h:334
float x_height
Definition: pageres.h:431
inT32 whole_word_rej_count
Definition: pageres.h:289
float x_height() const
Definition: ocrrow.h:61
Definition: werd.h:60
inT32 char_count
Definition: pageres.h:287
WERD_LIST * word_list()
Definition: ocrrow.h:52
inT32 rej_count
Definition: pageres.h:288
#define ASSERT_HOST(x)
Definition: errcode.h:84
void copy_on(WERD_RES *word_res)
Definition: pageres.h:674
ROW * row
Definition: pageres.h:286
#define TRUE
Definition: capi.h:27
ROW_RES::~ROW_RES ( )
inline

Definition at line 297 of file pageres.h.

297  { // destructor
298  }

Member Data Documentation

inT32 ROW_RES::char_count

Definition at line 287 of file pageres.h.

inT32 ROW_RES::rej_count

Definition at line 288 of file pageres.h.

ROW* ROW_RES::row

Definition at line 286 of file pageres.h.

inT32 ROW_RES::whole_word_rej_count

Definition at line 289 of file pageres.h.

WERD_RES_LIST ROW_RES::word_res_list

Definition at line 290 of file pageres.h.


The documentation for this class was generated from the following files: