Tesseract
3.02
|
#include <stopper.h>
Public Member Functions | |
VIABLE_CHOICE_STRUCT () | |
VIABLE_CHOICE_STRUCT (int length) | |
~VIABLE_CHOICE_STRUCT () | |
void | Init (const WERD_CHOICE &word_choice, const PIECES_STATE &pieces_state, const float certainties[], FLOAT32 adjust_factor) |
Public Attributes | |
int | Length |
float | Rating |
float | Certainty |
FLOAT32 | AdjustFactor |
bool | ComposedFromCharFragments |
CHAR_CHOICE * | Blob |
VIABLE_CHOICE_STRUCT::VIABLE_CHOICE_STRUCT | ( | ) |
Definition at line 106 of file stopper.cpp.
VIABLE_CHOICE_STRUCT::VIABLE_CHOICE_STRUCT | ( | int | length | ) | [explicit] |
Definition at line 101 of file stopper.cpp.
: Length(length) { Blob = new CHAR_CHOICE[length]; }
VIABLE_CHOICE_STRUCT::~VIABLE_CHOICE_STRUCT | ( | ) |
Definition at line 110 of file stopper.cpp.
{ delete []Blob; }
void VIABLE_CHOICE_STRUCT::Init | ( | const WERD_CHOICE & | word_choice, |
const PIECES_STATE & | pieces_state, | ||
const float | certainties[], | ||
FLOAT32 | adjust_factor | ||
) |
Definition at line 114 of file stopper.cpp.
{ this->Rating = word_choice.rating(); this->Certainty = word_choice.certainty(); this->AdjustFactor = adjust_factor; this->ComposedFromCharFragments = false; ASSERT_HOST(this->Length == word_choice.length()); for (int i = 0, bw_idx = 0; i < word_choice.length(); i++, bw_idx++) { int blob_width = pieces_state[bw_idx]; CHAR_CHOICE *blob_choice = &this->Blob[i]; blob_choice->Class = word_choice.unichar_id(i); blob_choice->NumChunks = blob_width; blob_choice->Certainty = certainties[i]; for (int f = 1; f < word_choice.fragment_length(i); ++f) { blob_width = pieces_state[++bw_idx]; assert(blob_width > 0); blob_choice->NumChunks += blob_width; this->ComposedFromCharFragments = true; } } }