diff --git a/src/ccstruct/ratngs.cpp b/src/ccstruct/ratngs.cpp index 2012d57944..b61cf55294 100644 --- a/src/ccstruct/ratngs.cpp +++ b/src/ccstruct/ratngs.cpp @@ -529,12 +529,7 @@ WERD_CHOICE& WERD_CHOICE::operator=(const WERD_CHOICE& source) { // to get the target positions. If small_caps is true, sub/super are not // considered, but dropcaps are. // NOTE: blobs_list should be the chopped_word blobs. (Fully segemented.) -void WERD_CHOICE::SetScriptPositions(bool small_caps, TWERD* word) { - // Since WERD_CHOICE isn't supposed to depend on a Tesseract, - // we don't have easy access to the flags Tesseract stores. Therefore, debug - // for this module is hard compiled in. - int debug = 0; - +void WERD_CHOICE::SetScriptPositions(bool small_caps, TWERD* word, int debug) { // Initialize to normal. for (int i = 0; i < length_; ++i) script_pos_[i] = tesseract::SP_NORMAL; diff --git a/src/ccstruct/ratngs.h b/src/ccstruct/ratngs.h index 08b0e1092e..18b2ac8ce7 100644 --- a/src/ccstruct/ratngs.h +++ b/src/ccstruct/ratngs.h @@ -552,7 +552,7 @@ class WERD_CHOICE : public ELIST_LINK { // to get the target positions. If small_caps is true, sub/super are not // considered, but dropcaps are. // NOTE: blobs_list should be the chopped_word blobs. (Fully segemented.) - void SetScriptPositions(bool small_caps, TWERD* word); + void SetScriptPositions(bool small_caps, TWERD* word, int debug = 0); // Sets the script_pos_ member from some source positions with a given length. void SetScriptPositions(const tesseract::ScriptPos* positions, int length); // Sets all the script_pos_ positions to the given position. diff --git a/src/wordrec/language_model.cpp b/src/wordrec/language_model.cpp index 5f11b5c033..cc506a3eee 100644 --- a/src/wordrec/language_model.cpp +++ b/src/wordrec/language_model.cpp @@ -1284,7 +1284,7 @@ void LanguageModel::UpdateBestChoice( return; } if (word_res->chopped_word != nullptr && !word_res->chopped_word->blobs.empty()) - word->SetScriptPositions(false, word_res->chopped_word); + word->SetScriptPositions(false, word_res->chopped_word, language_model_debug_level); // Update and log new raw_choice if needed. if (word_res->raw_choice == nullptr || word->rating() < word_res->raw_choice->rating()) {