src/ccstruct/pageres.cpp
void WERD_RES::FakeClassifyWord(unsigned blob_count, BLOB_CHOICE **choices) {
  // Setup the WERD_RES.
  ASSERT_HOST(box_word != nullptr);
  ASSERT_HOST(blob_count == box_word->length());
  ClearWordChoices();
  ClearRatings();
  ratings = new MATRIX(blob_count, 1);
  for (unsigned c = 0; c < blob_count; ++c) {
    auto *choice_list = new BLOB_CHOICE_LIST;
    BLOB_CHOICE_IT choice_it(choice_list);
    choice_it.add_after_then_move(choices[c]);
    ratings->put(c, c, choice_list);
  }
  FakeWordFromRatings(TOP_CHOICE_PERM);
  reject_map.initialise(blob_count);
  best_state.clear();
  best_state.resize(blob_count, 1);
  done = true;
}
// Classifies the word with some already-calculated BLOB_CHOICEs.
// The choices are an array of blob_count pointers to BLOB_CHOICE,
// providing a single classifier result for each blob.
// The BLOB_CHOICEs are consumed and the word takes ownership.
// The number of blobs in the box_word must match blob_count.
Classifies the word with some already-calculated BLOB_CHOICEs.
The choices are an array of blob_count pointers to BLOB_CHOICE,
providing a single classifier result for each blob.
The BLOB_CHOICEs are consumed and the word takes ownership.
The number of blobs in the box_word must match blob_count.
Classifies the word with some already - calculated BLOB_CHOICEs . The choices are an array of blob_count pointers to BLOB_CHOICE providing a single classifier result for each blob . The BLOB_CHOICEs are consumed and the word takes ownership . The number of blobs in the box_word must match blob_count .
void WERD_RES::FakeClassifyWord(unsigned blob_count, BLOB_CHOICE **choices) {
  ASSERT_HOST(box_word != nullptr);
  ASSERT_HOST(blob_count == box_word->length());
  ClearWordChoices();
  ClearRatings();
  ratings = new MATRIX(blob_count, 1);
  for (unsigned c = 0; c < blob_count; ++c) {
    auto *choice_list = new BLOB_CHOICE_LIST;
    BLOB_CHOICE_IT choice_it(choice_list);
    choice_it.add_after_then_move(choices[c]);
    ratings->put(c, c, choice_list);
  }
  FakeWordFromRatings(TOP_CHOICE_PERM);
  reject_map.initialise(blob_count);
  best_state.clear();
  best_state.resize(blob_count, 1);
  done = true;
}
void WERD_RES :: FakeClassifyWord ( unsigned blob_count , BLOB_CHOICE * * choices ) { ASSERT_HOST ( box_word != nullptr ) ; ASSERT_HOST ( blob_count == box_word -> length ( ) ) ; ClearWordChoices ( ) ; ClearRatings ( ) ; ratings = new MATRIX ( blob_count , 1 ) ; for ( unsigned c = 0 ; c < blob_count ; ++ c ) { auto * choice_list = new BLOB_CHOICE_LIST ; BLOB_CHOICE_IT choice_it ( choice_list ) ; choice_it . add_after_then_move ( choices [ c ] ) ; ratings -> put ( c , c , choice_list ) ; } FakeWordFromRatings ( TOP_CHOICE_PERM ) ; reject_map . initialise ( blob_count ) ; best_state . clear ( ) ; best_state . resize ( blob_count , 1 ) ; done = true ; }
Classifies the word with some already-calculated BLOB_CHOICEs.
Classifies the word with some already - calculated BLOB_CHOICEs .
// Setup the WERD_RES.