Tesseract  3.02
VIABLE_CHOICE_STRUCT Class Reference

#include <stopper.h>

List of all members.

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_CHOICEBlob

Detailed Description

Definition at line 55 of file stopper.h.


Constructor & Destructor Documentation

VIABLE_CHOICE_STRUCT::VIABLE_CHOICE_STRUCT ( )

Definition at line 106 of file stopper.cpp.

                                           : Length(0) {
  Blob = NULL;
}
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;
}

Member Function Documentation

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;
    }
  }
}

Member Data Documentation

Definition at line 72 of file stopper.h.

Definition at line 69 of file stopper.h.

Definition at line 67 of file stopper.h.

Definition at line 68 of file stopper.h.


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