From 03f3c9dc8874e2bb350b237d4737c3a457bfea7c Mon Sep 17 00:00:00 2001 From: Ray Smith Date: Tue, 12 May 2015 18:13:15 -0700 Subject: [PATCH] Misc fixes missed from previous commits --- api/renderer.cpp | 2 +- ccmain/resultiterator.cpp | 10 +++++----- ccstruct/boxread.cpp | 2 +- classify/adaptmatch.cpp | 3 --- classify/ocrfeatures.h | 6 ++---- 5 files changed, 9 insertions(+), 14 deletions(-) diff --git a/api/renderer.cpp b/api/renderer.cpp index 2664a9b7bd..83b4f53efd 100644 --- a/api/renderer.cpp +++ b/api/renderer.cpp @@ -117,7 +117,7 @@ bool TessTextRenderer::AddImageHandler(TessBaseAPI* api) { bool pageBreak = false; api->GetBoolVariable("include_page_breaks", &pageBreak); const char* pageSeparator = api->GetStringVariable("page_separator"); - if(pageBreak) { + if (pageBreak) { AppendString(pageSeparator); } diff --git a/ccmain/resultiterator.cpp b/ccmain/resultiterator.cpp index b3f5321d18..77514a6a59 100644 --- a/ccmain/resultiterator.cpp +++ b/ccmain/resultiterator.cpp @@ -37,8 +37,8 @@ ResultIterator::ResultIterator(const LTRResultIterator &resit) preserve_interword_spaces_ = false; BoolParam *p = ParamUtils::FindParam( - "preserve_interword_spaces", GlobalParams()->bool_params, - tesseract_->params()->bool_params); + "preserve_interword_spaces", GlobalParams()->bool_params, + tesseract_->params()->bool_params); if (p != NULL) preserve_interword_spaces_ = (bool)(*p); current_paragraph_is_ltr_ = CurrentParagraphIsLtr(); @@ -636,9 +636,9 @@ void ResultIterator::IterateAndAppendUTF8TextlineText(STRING *text) { int words_appended = 0; do { - int numSpaces = preserve_interword_spaces_ ? it_->word()->word->space() : - (words_appended > 0); - for(int i = 0 ; i < numSpaces ; ++i) { + int numSpaces = preserve_interword_spaces_ ? it_->word()->word->space() + : (words_appended > 0); + for (int i = 0; i < numSpaces; ++i) { *text += " "; } AppendUTF8WordText(text); diff --git a/ccstruct/boxread.cpp b/ccstruct/boxread.cpp index a91261391e..947fcc02fe 100644 --- a/ccstruct/boxread.cpp +++ b/ccstruct/boxread.cpp @@ -78,7 +78,7 @@ bool ReadMemBoxes(int target_page, bool skip_blanks, const char* box_data, if (!ParseBoxFileStr(lines[i].string(), &page, &utf8_str, &box)) { continue; } - if (skip_blanks && utf8_str == " ") continue; + if (skip_blanks && (utf8_str == " " || utf8_str == "\t")) continue; if (target_page >= 0 && page != target_page) continue; if (boxes != NULL) boxes->push_back(box); if (texts != NULL) texts->push_back(utf8_str); diff --git a/classify/adaptmatch.cpp b/classify/adaptmatch.cpp index e9ff913b77..aebf64893f 100644 --- a/classify/adaptmatch.cpp +++ b/classify/adaptmatch.cpp @@ -206,9 +206,6 @@ void Classify::AdaptiveClassifier(TBLOB *Blob, BLOB_CHOICE_LIST *Choices) { PrintAdaptiveMatchResults(*Results); } - if (LargeSpeckle(*Blob) || Choices->length() == 0) - AddLargeSpeckleTo(Results->BlobLength, Choices); - #ifndef GRAPHICS_DISABLED if (classify_enable_adaptive_debugger) DebugAdaptiveClassifier(Blob, Results); diff --git a/classify/ocrfeatures.h b/classify/ocrfeatures.h index 7d6ba95dab..31a4794ca6 100644 --- a/classify/ocrfeatures.h +++ b/classify/ocrfeatures.h @@ -118,10 +118,8 @@ FEATURE ReadFeature(FILE *File, const FEATURE_DESC_STRUCT *FeatureDesc); FEATURE_SET ReadFeatureSet(FILE *File, const FEATURE_DESC_STRUCT *FeatureDesc); -void WriteFeature(FILE *File, FEATURE Feature); +void WriteFeature(FEATURE Feature, STRING* str); -void WriteFeatureSet(FILE *File, FEATURE_SET FeatureSet); - -void WriteOldParamDesc(FILE *File, const FEATURE_DESC_STRUCT *FeatureDesc); +void WriteFeatureSet(FEATURE_SET FeatureSet, STRING* str); #endif