Skip to content

Commit

Permalink
Misc fixes missed from previous commits
Browse files Browse the repository at this point in the history
  • Loading branch information
theraysmith committed May 13, 2015
1 parent b2a3924 commit 03f3c9d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion api/renderer.cpp
Expand Up @@ -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);
}

Expand Down
10 changes: 5 additions & 5 deletions ccmain/resultiterator.cpp
Expand Up @@ -37,8 +37,8 @@ ResultIterator::ResultIterator(const LTRResultIterator &resit)
preserve_interword_spaces_ = false;

BoolParam *p = ParamUtils::FindParam<BoolParam>(
"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();
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion ccstruct/boxread.cpp
Expand Up @@ -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);
Expand Down
3 changes: 0 additions & 3 deletions classify/adaptmatch.cpp
Expand Up @@ -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);
Expand Down
6 changes: 2 additions & 4 deletions classify/ocrfeatures.h
Expand Up @@ -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

0 comments on commit 03f3c9d

Please sign in to comment.