|
Tesseract
3.02
|
#include <ltrresultiterator.h>
Public Member Functions | |
| ChoiceIterator (const LTRResultIterator &result_it) | |
| ~ChoiceIterator () | |
| bool | Next () |
| const char * | GetUTF8Text () const |
| float | Confidence () const |
Definition at line 170 of file ltrresultiterator.h.
| tesseract::ChoiceIterator::ChoiceIterator | ( | const LTRResultIterator & | result_it | ) | [explicit] |
Definition at line 318 of file ltrresultiterator.cpp.
{
ASSERT_HOST(result_it.it_->word() != NULL);
word_res_ = result_it.it_->word();
PAGE_RES_IT res_it(*result_it.it_);
WERD_CHOICE* best_choice = word_res_->best_choice;
BLOB_CHOICE_LIST_CLIST* choices = best_choice->blob_choices();
if (choices != NULL) {
BLOB_CHOICE_LIST_C_IT blob_choices_it(choices);
for (int blob = 0; blob < result_it.blob_index_; ++blob)
blob_choices_it.forward();
choice_it_ = new BLOB_CHOICE_IT(blob_choices_it.data());
choice_it_->mark_cycle_pt();
} else {
choice_it_ = NULL;
}
}
| tesseract::ChoiceIterator::~ChoiceIterator | ( | ) |
Definition at line 335 of file ltrresultiterator.cpp.
{
delete choice_it_;
}
| float tesseract::ChoiceIterator::Confidence | ( | ) | const |
Definition at line 359 of file ltrresultiterator.cpp.
| const char * tesseract::ChoiceIterator::GetUTF8Text | ( | ) | const |
Definition at line 350 of file ltrresultiterator.cpp.
{
if (choice_it_ == NULL)
return NULL;
UNICHAR_ID id = choice_it_->data()->unichar_id();
return word_res_->BestUTF8(id, false);
}
| bool tesseract::ChoiceIterator::Next | ( | ) |
Definition at line 341 of file ltrresultiterator.cpp.
{
if (choice_it_ == NULL)
return false;
choice_it_->forward();
return !choice_it_->cycled_list();
}