mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-01-06 09:17:49 +08:00
Fix issue detected by Coverity Scan
CID: 1164533 (Logically dead code) Signed-off-by: Noah Metzger <noah.metzger@bib.uni-mannheim.de>
This commit is contained in:
parent
d4490af06d
commit
2d96c66126
@ -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
|
// to get the target positions. If small_caps is true, sub/super are not
|
||||||
// considered, but dropcaps are.
|
// considered, but dropcaps are.
|
||||||
// NOTE: blobs_list should be the chopped_word blobs. (Fully segemented.)
|
// NOTE: blobs_list should be the chopped_word blobs. (Fully segemented.)
|
||||||
void WERD_CHOICE::SetScriptPositions(bool small_caps, TWERD* word) {
|
void WERD_CHOICE::SetScriptPositions(bool small_caps, TWERD* word, int debug) {
|
||||||
// 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;
|
|
||||||
|
|
||||||
// Initialize to normal.
|
// Initialize to normal.
|
||||||
for (int i = 0; i < length_; ++i)
|
for (int i = 0; i < length_; ++i)
|
||||||
script_pos_[i] = tesseract::SP_NORMAL;
|
script_pos_[i] = tesseract::SP_NORMAL;
|
||||||
|
@ -552,7 +552,7 @@ class WERD_CHOICE : public ELIST_LINK {
|
|||||||
// to get the target positions. If small_caps is true, sub/super are not
|
// to get the target positions. If small_caps is true, sub/super are not
|
||||||
// considered, but dropcaps are.
|
// considered, but dropcaps are.
|
||||||
// NOTE: blobs_list should be the chopped_word blobs. (Fully segemented.)
|
// 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.
|
// Sets the script_pos_ member from some source positions with a given length.
|
||||||
void SetScriptPositions(const tesseract::ScriptPos* positions, int length);
|
void SetScriptPositions(const tesseract::ScriptPos* positions, int length);
|
||||||
// Sets all the script_pos_ positions to the given position.
|
// Sets all the script_pos_ positions to the given position.
|
||||||
|
@ -1284,7 +1284,7 @@ void LanguageModel::UpdateBestChoice(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (word_res->chopped_word != nullptr && !word_res->chopped_word->blobs.empty())
|
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.
|
// Update and log new raw_choice if needed.
|
||||||
if (word_res->raw_choice == nullptr ||
|
if (word_res->raw_choice == nullptr ||
|
||||||
word->rating() < word_res->raw_choice->rating()) {
|
word->rating() < word_res->raw_choice->rating()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user