tesseract
3.03
|
#include <ltrresultiterator.h>
Public Member Functions | |
ChoiceIterator (const LTRResultIterator &result_it) | |
~ChoiceIterator () | |
bool | Next () |
const char * | GetUTF8Text () const |
float | Confidence () const |
Definition at line 181 of file ltrresultiterator.h.
tesseract::ChoiceIterator::ChoiceIterator | ( | const LTRResultIterator & | result_it | ) | [explicit] |
Definition at line 331 of file ltrresultiterator.cpp.
{ ASSERT_HOST(result_it.it_->word() != NULL); word_res_ = result_it.it_->word(); BLOB_CHOICE_LIST* choices = NULL; if (word_res_->ratings != NULL) choices = word_res_->GetBlobChoices(result_it.blob_index_); if (choices != NULL && !choices->empty()) { choice_it_ = new BLOB_CHOICE_IT(choices); choice_it_->mark_cycle_pt(); } else { choice_it_ = NULL; } }
Definition at line 345 of file ltrresultiterator.cpp.
{
delete choice_it_;
}
float tesseract::ChoiceIterator::Confidence | ( | ) | const |
Definition at line 369 of file ltrresultiterator.cpp.
{ if (choice_it_ == NULL) return 0.0f; float confidence = 100 + 5 * choice_it_->data()->certainty(); if (confidence < 0.0f) confidence = 0.0f; if (confidence > 100.0f) confidence = 100.0f; return confidence; }
const char * tesseract::ChoiceIterator::GetUTF8Text | ( | ) | const |
Definition at line 360 of file ltrresultiterator.cpp.
{ if (choice_it_ == NULL) return NULL; UNICHAR_ID id = choice_it_->data()->unichar_id(); return word_res_->uch_set->id_to_unichar_ext(id); }
bool tesseract::ChoiceIterator::Next | ( | ) |
Definition at line 351 of file ltrresultiterator.cpp.
{ if (choice_it_ == NULL) return false; choice_it_->forward(); return !choice_it_->cycled_list(); }