#include <ltrresultiterator.h>
Definition at line 182 of file ltrresultiterator.h.
◆ ChoiceIterator()
Definition at line 382 of file ltrresultiterator.cpp.
384 word_res_ = result_it.it_->
word();
389 bool lstm_choice_mode = word_res_->
tesseract->lstm_choice_mode;
390 rating_coefficient_ = word_res_->
tesseract->lstm_rating_coefficient;
391 blanks_before_word_ = result_it.BlanksBeforeWord();
392 BLOB_CHOICE_LIST *choices =
nullptr;
393 tstep_index_ = &result_it.blob_index_;
397 blanks_before_word_ = 0;
399 unsigned index = *tstep_index_;
400 index += blanks_before_word_;
401 if (index < word_res_->CTC_symbol_choices.size()) {
406 if ((oemLegacy || !lstm_choice_mode) && word_res_->
ratings !=
nullptr) {
409 if (choices !=
nullptr && !choices->empty()) {
410 choice_it_ =
new BLOB_CHOICE_IT(choices);
411 choice_it_->mark_cycle_pt();
413 choice_it_ =
nullptr;
415 if (LSTM_choices_ !=
nullptr && !LSTM_choices_->empty()) {
416 LSTM_choice_it_ = LSTM_choices_->begin();
tesseract::Tesseract * tesseract
BLOB_CHOICE_LIST * GetBlobChoices(int index) const
std::vector< std::vector< std::pair< const char *, float > > > CTC_symbol_choices
◆ ~ChoiceIterator()
tesseract::ChoiceIterator::~ChoiceIterator |
( |
| ) |
|
◆ Confidence()
float tesseract::ChoiceIterator::Confidence |
( |
| ) |
const |
Definition at line 464 of file ltrresultiterator.cpp.
466 if (oemLSTM_ && LSTM_choices_ !=
nullptr && !LSTM_choices_->empty()) {
467 std::pair<const char *, float> choice = *LSTM_choice_it_;
468 confidence = 100 - rating_coefficient_ * choice.second;
470 if (choice_it_ ==
nullptr) {
473 confidence = 100 + 5 * choice_it_->data()->certainty();
T ClipToRange(const T &x, const T &lower_bound, const T &upper_bound)
◆ GetUTF8Text()
const char * tesseract::ChoiceIterator::GetUTF8Text |
( |
| ) |
const |
Definition at line 445 of file ltrresultiterator.cpp.
446 if (oemLSTM_ && LSTM_choices_ !=
nullptr && !LSTM_choices_->empty()) {
447 std::pair<const char *, float> choice = *LSTM_choice_it_;
450 if (choice_it_ ==
nullptr) {
453 UNICHAR_ID id = choice_it_->data()->unichar_id();
const UNICHARSET * uch_set
const char * id_to_unichar_ext(UNICHAR_ID id) const
◆ Next()
bool tesseract::ChoiceIterator::Next |
( |
| ) |
|
Definition at line 425 of file ltrresultiterator.cpp.
426 if (oemLSTM_ && LSTM_choices_ !=
nullptr && !LSTM_choices_->empty()) {
427 if (LSTM_choice_it_ == LSTM_choices_->end() ||
428 next(LSTM_choice_it_) == LSTM_choices_->end()) {
435 if (choice_it_ ==
nullptr) {
438 choice_it_->forward();
439 return !choice_it_->cycled_list();
◆ Timesteps()
std::vector< std::vector< std::pair< const char *, float > > > * tesseract::ChoiceIterator::Timesteps |
( |
| ) |
const |
Definition at line 479 of file ltrresultiterator.cpp.
480 unsigned offset = *tstep_index_ + blanks_before_word_;
std::vector< std::vector< std::vector< std::pair< const char *, float > > > > segmented_timesteps
The documentation for this class was generated from the following files: