From b3bd23edb796a649aaefdef0004d256a21455906 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Tue, 19 Feb 2019 13:53:31 +0100 Subject: [PATCH] Remove whitespace at line endings Signed-off-by: Stefan Weil --- INSTALL.GIT.md | 2 +- src/api/baseapi.h | 6 +++--- src/api/lstmboxrenderer.cpp | 8 ++++---- src/api/tesseractmain.cpp | 2 +- src/lstm/recodebeam.h | 5 ++--- src/textord/colfind.cpp | 3 +-- src/training/tesstrain.sh | 4 ++-- unittest/lstm_test.cc | 2 +- unittest/lstm_test.h | 2 +- unittest/resultiterator_test.cc | 2 +- 10 files changed, 17 insertions(+), 19 deletions(-) diff --git a/INSTALL.GIT.md b/INSTALL.GIT.md index d06104ee80..9650cc1620 100644 --- a/INSTALL.GIT.md +++ b/INSTALL.GIT.md @@ -41,7 +41,7 @@ all languages). You need an Internet connection and [curl](https://curl.haxx.se/) to compile `ScrollView.jar` because the build will automatically download [piccolo2d-core-3.0.jar](http://search.maven.org/remotecontent?filepath=org/piccolo2d/piccolo2d-core/3.0/piccolo2d-core-3.0.jar > piccolo2d-core-3.0.jar) and -[piccolo2d-extras-3.0.jar](http://search.maven.org/remotecontent?filepath=org/piccolo2d/piccolo2d-extras/3.0/piccolo2d-extras-3.0.jar) and +[piccolo2d-extras-3.0.jar](http://search.maven.org/remotecontent?filepath=org/piccolo2d/piccolo2d-extras/3.0/piccolo2d-extras-3.0.jar) and [jaxb-api-2.3.1.jar](http://search.maven.org/remotecontent?filepath=javax/xml/bind/jaxb-api/2.3.1/jaxb-api-2.3.1.jar) and place them to `tesseract/java`. Just run: diff --git a/src/api/baseapi.h b/src/api/baseapi.h index 31c43b1d9a..62335ae655 100644 --- a/src/api/baseapi.h +++ b/src/api/baseapi.h @@ -613,7 +613,7 @@ class TESS_API TessBaseAPI { * Returned string must be freed with the delete [] operator. */ char* GetTSVText(int page_number); - + /** * Make a box file for LSTM training from the internal data structures. * Constructs coordinates in the original image - not just the rectangle. @@ -630,7 +630,7 @@ class TESS_API TessBaseAPI { * Returned string must be freed with the delete [] operator. */ char* GetBoxText(int page_number); - + /** * The recognized text is returned as a char* which is coded in the same * format as a WordStr box file used in training. @@ -638,7 +638,7 @@ class TESS_API TessBaseAPI { * Returned string must be freed with the delete [] operator. */ char* GetWordStrBoxText(int page_number); - + /** * The recognized text is returned as a char* which is coded * as UNLV format Latin-1 with specific reject and suspect codes. diff --git a/src/api/lstmboxrenderer.cpp b/src/api/lstmboxrenderer.cpp index 37c9259449..f5cdce36bb 100644 --- a/src/api/lstmboxrenderer.cpp +++ b/src/api/lstmboxrenderer.cpp @@ -27,15 +27,15 @@ namespace tesseract { * page_number is a 0-base page index that will appear in the box file. * Returned string must be freed with the delete [] operator. */ -static void AddBoxToLSTM(int right, int bottom, int top, +static void AddBoxToLSTM(int right, int bottom, int top, int image_height_, int page_num, STRING* text) { text->add_str_int(" ", image_height_ - bottom); text->add_str_int(" ", right + 5); text->add_str_int(" ", image_height_ - top); - text->add_str_int(" ", page_num); + text->add_str_int(" ", page_num); } - + char* TessBaseAPI::GetLSTMBOXText(int page_number) { if (tesseract_ == nullptr || (page_res_ == nullptr && Recognize(nullptr) < 0)) return nullptr; @@ -44,7 +44,7 @@ char* TessBaseAPI::GetLSTMBOXText(int page_number) { int page_num = page_number; bool first_word = true; int left, top, right, bottom; - + LTRResultIterator* res_it = GetLTRIterator(); while (!res_it->Empty(RIL_BLOCK)) { if (res_it->Empty(RIL_SYMBOL)) { diff --git a/src/api/tesseractmain.cpp b/src/api/tesseractmain.cpp index ef565934f9..b24007ea97 100644 --- a/src/api/tesseractmain.cpp +++ b/src/api/tesseractmain.cpp @@ -537,7 +537,7 @@ static void PreloadRenderers( error = true; } } - + api->GetBoolVariable("tessedit_create_txt", &b); if (b || (!error && renderers->empty())) { tesseract::TessTextRenderer* renderer = diff --git a/src/lstm/recodebeam.h b/src/lstm/recodebeam.h index ef4621028d..6bd44653b4 100644 --- a/src/lstm/recodebeam.h +++ b/src/lstm/recodebeam.h @@ -3,7 +3,6 @@ // Description: Beam search to decode from the re-encoded CJK as a sequence of // smaller numbers in place of a single large code. // Author: Ray Smith -// Created: Fri Mar 13 09:12:01 PDT 2015 // // (C) Copyright 2015, Google Inc. // Licensed under the Apache License, Version 2.0 (the "License"); @@ -210,8 +209,8 @@ class RecodeBeamSearch { // Generates debug output of the content of the beams after a Decode. void DebugBeams(const UNICHARSET& unicharset) const; - - // Stores the alternative characters of every timestep together with their + + // Stores the alternative characters of every timestep together with their // probability. std::vector< std::vector>> timesteps; diff --git a/src/textord/colfind.cpp b/src/textord/colfind.cpp index 5b17bd880b..67ca8af5cc 100644 --- a/src/textord/colfind.cpp +++ b/src/textord/colfind.cpp @@ -3,7 +3,6 @@ // Description: Class to hold BLOBNBOXs in a grid for fast access // to neighbours. // Author: Ray Smith -// Created: Wed Jun 06 17:22:01 PDT 2007 // // (C) Copyright 2007, Google Inc. // Licensed under the Apache License, Version 2.0 (the "License"); @@ -926,7 +925,7 @@ void ColumnFinder::ComputeMeanColumnGap(bool any_multi_column) { &gap_samples); } mean_column_gap_ = any_multi_column && gap_samples > 0 - ? total_gap / gap_samples : width_samples > 0 + ? total_gap / gap_samples : width_samples > 0 ? total_width / width_samples : 0; } diff --git a/src/training/tesstrain.sh b/src/training/tesstrain.sh index 714376b400..290d8c4da9 100755 --- a/src/training/tesstrain.sh +++ b/src/training/tesstrain.sh @@ -29,11 +29,11 @@ echo -e "USAGE: tesstrain.sh --maxpages # Specify maximum pages to output (default:0=all) --save_box_tiff # Save box/tiff pairs along with lstmf files. --xsize # Specify width of output image (default:3600) - + OPTIONAL flag for specifying directory with user specified box/tiff pairs. Files should be named similar to ${LANG_CODE}.${fontname}.exp${EXPOSURE}.box/tif --my_boxtiff_dir MY_BOXTIFF_DIR # Location of user specified box/tiff files. - + OPTIONAL flags for input data. If unspecified we will look for them in the langdata_dir directory. --training_text TEXTFILE # Text to render and use for training. diff --git a/unittest/lstm_test.cc b/unittest/lstm_test.cc index fc4f0c2b79..ef8aec6b6a 100644 --- a/unittest/lstm_test.cc +++ b/unittest/lstm_test.cc @@ -11,7 +11,7 @@ // Generating the training data: // If the format of the lstmf (ImageData) file changes, the training data will -// have to be regenerated as follows: +// have to be regenerated as follows: // // Use --xsize 800 for text2image to be similar to original training data. // diff --git a/unittest/lstm_test.h b/unittest/lstm_test.h index d5e9eb0298..68a828ef95 100644 --- a/unittest/lstm_test.h +++ b/unittest/lstm_test.h @@ -58,7 +58,7 @@ class LSTMTrainerTest : public testing::Test { return file::JoinPath(TESTING_DIR, "" + name); } - + void SetupTrainerEng(const std::string& network_spec, const std::string& model_name, bool recode, bool adam) { SetupTrainer(network_spec, model_name, "eng/eng.unicharset", diff --git a/unittest/resultiterator_test.cc b/unittest/resultiterator_test.cc index 8f68a7001d..d441c25d19 100644 --- a/unittest/resultiterator_test.cc +++ b/unittest/resultiterator_test.cc @@ -235,7 +235,7 @@ class ResultIteratorTest : public testing::Test { // Tests layout analysis output (and scrollview) on the UNLV page numbered // 8087_054.3G.tif. (Dubrovnik), but only if --visual_test is true. -// +// //TEST_F(ResultIteratorTest, VisualTest) { // if (!FLAGS_visual_test) return; // const char* kIms[] = {"8087_054.3G.tif", "8071_093.3B.tif", nullptr};