MCPcopy Create free account
hub / github.com/creatale/node-dv / FakeClassifyWord

Method FakeClassifyWord

deps/tesseract/ccstruct/pageres.cpp:872–888  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

870// The BLOB_CHOICEs are consumed and the word takes ownership.
871// The number of blobs in the box_word must match blob_count.
872void WERD_RES::FakeClassifyWord(int blob_count, BLOB_CHOICE** choices) {
873 // Setup the WERD_RES.
874 ASSERT_HOST(box_word != NULL);
875 ASSERT_HOST(blob_count == box_word->length());
876 ClearWordChoices();
877 ClearRatings();
878 ratings = new MATRIX(blob_count, 1);
879 for (int c = 0; c < blob_count; ++c) {
880 BLOB_CHOICE_LIST* choice_list = new BLOB_CHOICE_LIST;
881 BLOB_CHOICE_IT choice_it(choice_list);
882 choice_it.add_after_then_move(choices[c]);
883 ratings->put(c, c, choice_list);
884 }
885 FakeWordFromRatings(TOP_CHOICE_PERM);
886 reject_map.initialise(blob_count);
887 done = true;
888}
889
890// Creates a WERD_CHOICE for the word using the top choices from the leading
891// diagonal of the ratings matrix.

Callers 2

MaximallyChopWordMethod · 0.80
cube_recognizeMethod · 0.80

Calls 4

putMethod · 0.80
initialiseMethod · 0.80
lengthMethod · 0.45
add_after_then_moveMethod · 0.45

Tested by

no test coverage detected