Tesseract 3.02

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Public Attributes
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)
void | SetBlobChoices (const BLOB_CHOICE_LIST_VECTOR &src_choices)

## Public Attributes
int | Length
float | Rating
float | Certainty
FLOAT32 | AdjustFactor
bool | ComposedFromCharFragments
CHAR_CHOICE * | Blob
BLOB_CHOICE_LIST_CLIST * | blob_choices

## Detailed Description

Definition at line 56 of file stopper.h.

## Constructor & Destructor Documentation

VIABLE_CHOICE_STRUCT::VIABLE_CHOICE_STRUCT | ( |  | ) |

Definition at line 107 of file stopper.cpp.

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

VIABLE_CHOICE_STRUCT::~VIABLE_CHOICE_STRUCT | ( |  | ) |

Definition at line 112 of file stopper.cpp.

{
delete []Blob;
if (blob_choices) {
blob_choices->deep_clear();
delete blob_choices;
}
}

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

void VIABLE_CHOICE_STRUCT::SetBlobChoices | ( | const BLOB_CHOICE_LIST_VECTOR & | src_choices | ) |

Definition at line 146 of file stopper.cpp.

{
if (blob_choices != NULL) {
blob_choices->deep_clear();
} else {
blob_choices = new BLOB_CHOICE_LIST_CLIST();
}
BLOB_CHOICE_LIST_C_IT list_it(blob_choices);
for (int i = 0; i < src_choices.size(); ++i) {
BLOB_CHOICE_LIST *cc_list = new BLOB_CHOICE_LIST();
cc_list->deep_copy(src_choices[i], &BLOB_CHOICE::deep_copy);
list_it.add_after_then_move(cc_list);
}
}

## Member Data Documentation

FLOAT32 VIABLE_CHOICE_STRUCT::AdjustFactor

Definition at line 72 of file stopper.h.

CHAR_CHOICE* VIABLE_CHOICE_STRUCT::Blob

Definition at line 74 of file stopper.h.

BLOB_CHOICE_LIST_CLIST* VIABLE_CHOICE_STRUCT::blob_choices

Definition at line 75 of file stopper.h.

float VIABLE_CHOICE_STRUCT::Certainty

Definition at line 71 of file stopper.h.

bool VIABLE_CHOICE_STRUCT::ComposedFromCharFragments

Definition at line 73 of file stopper.h.

int VIABLE_CHOICE_STRUCT::Length

Definition at line 69 of file stopper.h.

float VIABLE_CHOICE_STRUCT::Rating

Definition at line 70 of file stopper.h.

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

- /mnt/data/src/tesseract-ocr/dict/stopper.h
- /mnt/data/src/tesseract-ocr/dict/stopper.cpp