Skip to content

Commit

Permalink
Remove whitespace at line endings
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
stweil committed Feb 19, 2019
1 parent b95598a commit b3bd23e
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 19 deletions.
2 changes: 1 addition & 1 deletion INSTALL.GIT.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions src/api/baseapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -630,15 +630,15 @@ 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.
* page_number is a 0-based page index that will appear in the box file.
* 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.
Expand Down
8 changes: 4 additions & 4 deletions src/api/lstmboxrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)) {
Expand Down
2 changes: 1 addition & 1 deletion src/api/tesseractmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ static void PreloadRenderers(
error = true;
}
}

api->GetBoolVariable("tessedit_create_txt", &b);
if (b || (!error && renderers->empty())) {
tesseract::TessTextRenderer* renderer =
Expand Down
5 changes: 2 additions & 3 deletions src/lstm/recodebeam.h
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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<std::pair<const char*, float>>> timesteps;

Expand Down
3 changes: 1 addition & 2 deletions src/textord/colfind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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;
}

Expand Down
4 changes: 2 additions & 2 deletions src/training/tesstrain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion unittest/lstm_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//
Expand Down
2 changes: 1 addition & 1 deletion unittest/lstm_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion unittest/resultiterator_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down

0 comments on commit b3bd23e

Please sign in to comment.