mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-01-18 14:41:36 +08:00
Misc fixes missed from previous commits
This commit is contained in:
parent
b2a3924585
commit
03f3c9dc88
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user