Skip to content

Commit 03f3c9d

Browse files
committed
Misc fixes missed from previous commits
1 parent b2a3924 commit 03f3c9d

File tree

5 files changed

+9
-14
lines changed

5 files changed

+9
-14
lines changed

api/renderer.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ bool TessTextRenderer::AddImageHandler(TessBaseAPI* api) {
117117
bool pageBreak = false;
118118
api->GetBoolVariable("include_page_breaks", &pageBreak);
119119
const char* pageSeparator = api->GetStringVariable("page_separator");
120-
if(pageBreak) {
120+
if (pageBreak) {
121121
AppendString(pageSeparator);
122122
}
123123

ccmain/resultiterator.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ ResultIterator::ResultIterator(const LTRResultIterator &resit)
3737
preserve_interword_spaces_ = false;
3838

3939
BoolParam *p = ParamUtils::FindParam<BoolParam>(
40-
"preserve_interword_spaces", GlobalParams()->bool_params,
41-
tesseract_->params()->bool_params);
40+
"preserve_interword_spaces", GlobalParams()->bool_params,
41+
tesseract_->params()->bool_params);
4242
if (p != NULL) preserve_interword_spaces_ = (bool)(*p);
4343

4444
current_paragraph_is_ltr_ = CurrentParagraphIsLtr();
@@ -636,9 +636,9 @@ void ResultIterator::IterateAndAppendUTF8TextlineText(STRING *text) {
636636

637637
int words_appended = 0;
638638
do {
639-
int numSpaces = preserve_interword_spaces_ ? it_->word()->word->space() :
640-
(words_appended > 0);
641-
for(int i = 0 ; i < numSpaces ; ++i) {
639+
int numSpaces = preserve_interword_spaces_ ? it_->word()->word->space()
640+
: (words_appended > 0);
641+
for (int i = 0; i < numSpaces; ++i) {
642642
*text += " ";
643643
}
644644
AppendUTF8WordText(text);

ccstruct/boxread.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ bool ReadMemBoxes(int target_page, bool skip_blanks, const char* box_data,
7878
if (!ParseBoxFileStr(lines[i].string(), &page, &utf8_str, &box)) {
7979
continue;
8080
}
81-
if (skip_blanks && utf8_str == " ") continue;
81+
if (skip_blanks && (utf8_str == " " || utf8_str == "\t")) continue;
8282
if (target_page >= 0 && page != target_page) continue;
8383
if (boxes != NULL) boxes->push_back(box);
8484
if (texts != NULL) texts->push_back(utf8_str);

classify/adaptmatch.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,6 @@ void Classify::AdaptiveClassifier(TBLOB *Blob, BLOB_CHOICE_LIST *Choices) {
206206
PrintAdaptiveMatchResults(*Results);
207207
}
208208

209-
if (LargeSpeckle(*Blob) || Choices->length() == 0)
210-
AddLargeSpeckleTo(Results->BlobLength, Choices);
211-
212209
#ifndef GRAPHICS_DISABLED
213210
if (classify_enable_adaptive_debugger)
214211
DebugAdaptiveClassifier(Blob, Results);

classify/ocrfeatures.h

+2-4
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,8 @@ FEATURE ReadFeature(FILE *File, const FEATURE_DESC_STRUCT *FeatureDesc);
118118

119119
FEATURE_SET ReadFeatureSet(FILE *File, const FEATURE_DESC_STRUCT *FeatureDesc);
120120

121-
void WriteFeature(FILE *File, FEATURE Feature);
121+
void WriteFeature(FEATURE Feature, STRING* str);
122122

123-
void WriteFeatureSet(FILE *File, FEATURE_SET FeatureSet);
124-
125-
void WriteOldParamDesc(FILE *File, const FEATURE_DESC_STRUCT *FeatureDesc);
123+
void WriteFeatureSet(FEATURE_SET FeatureSet, STRING* str);
126124

127125
#endif

0 commit comments

Comments
 (0)