diff --git a/src/training/commandlineflags.cpp b/src/training/common/commandlineflags.cpp similarity index 100% rename from src/training/commandlineflags.cpp rename to src/training/common/commandlineflags.cpp diff --git a/src/training/commandlineflags.h b/src/training/common/commandlineflags.h similarity index 100% rename from src/training/commandlineflags.h rename to src/training/common/commandlineflags.h diff --git a/src/training/commontraining.cpp b/src/training/common/commontraining.cpp similarity index 100% rename from src/training/commontraining.cpp rename to src/training/common/commontraining.cpp diff --git a/src/training/commontraining.h b/src/training/common/commontraining.h similarity index 100% rename from src/training/commontraining.h rename to src/training/common/commontraining.h diff --git a/src/training/ctc.cpp b/src/training/common/ctc.cpp similarity index 100% rename from src/training/ctc.cpp rename to src/training/common/ctc.cpp diff --git a/src/training/ctc.h b/src/training/common/ctc.h similarity index 100% rename from src/training/ctc.h rename to src/training/common/ctc.h diff --git a/src/training/errorcounter.cpp b/src/training/common/errorcounter.cpp similarity index 100% rename from src/training/errorcounter.cpp rename to src/training/common/errorcounter.cpp diff --git a/src/training/errorcounter.h b/src/training/common/errorcounter.h similarity index 100% rename from src/training/errorcounter.h rename to src/training/common/errorcounter.h diff --git a/src/training/intfeaturedist.cpp b/src/training/common/intfeaturedist.cpp similarity index 100% rename from src/training/intfeaturedist.cpp rename to src/training/common/intfeaturedist.cpp diff --git a/src/training/intfeaturedist.h b/src/training/common/intfeaturedist.h similarity index 100% rename from src/training/intfeaturedist.h rename to src/training/common/intfeaturedist.h diff --git a/src/training/intfeaturemap.cpp b/src/training/common/intfeaturemap.cpp similarity index 100% rename from src/training/intfeaturemap.cpp rename to src/training/common/intfeaturemap.cpp diff --git a/src/training/intfeaturemap.h b/src/training/common/intfeaturemap.h similarity index 100% rename from src/training/intfeaturemap.h rename to src/training/common/intfeaturemap.h diff --git a/src/training/mastertrainer.cpp b/src/training/common/mastertrainer.cpp similarity index 100% rename from src/training/mastertrainer.cpp rename to src/training/common/mastertrainer.cpp diff --git a/src/training/mastertrainer.h b/src/training/common/mastertrainer.h similarity index 100% rename from src/training/mastertrainer.h rename to src/training/common/mastertrainer.h diff --git a/src/training/networkbuilder.cpp b/src/training/common/networkbuilder.cpp similarity index 100% rename from src/training/networkbuilder.cpp rename to src/training/common/networkbuilder.cpp diff --git a/src/training/networkbuilder.h b/src/training/common/networkbuilder.h similarity index 100% rename from src/training/networkbuilder.h rename to src/training/common/networkbuilder.h diff --git a/src/training/sampleiterator.cpp b/src/training/common/sampleiterator.cpp similarity index 100% rename from src/training/sampleiterator.cpp rename to src/training/common/sampleiterator.cpp diff --git a/src/training/sampleiterator.h b/src/training/common/sampleiterator.h similarity index 100% rename from src/training/sampleiterator.h rename to src/training/common/sampleiterator.h diff --git a/src/training/trainingsampleset.cpp b/src/training/common/trainingsampleset.cpp similarity index 100% rename from src/training/trainingsampleset.cpp rename to src/training/common/trainingsampleset.cpp diff --git a/src/training/trainingsampleset.h b/src/training/common/trainingsampleset.h similarity index 100% rename from src/training/trainingsampleset.h rename to src/training/common/trainingsampleset.h diff --git a/src/training/boxchar.cpp b/src/training/pango/boxchar.cpp similarity index 100% rename from src/training/boxchar.cpp rename to src/training/pango/boxchar.cpp diff --git a/src/training/boxchar.h b/src/training/pango/boxchar.h similarity index 100% rename from src/training/boxchar.h rename to src/training/pango/boxchar.h diff --git a/src/training/ligature_table.cpp b/src/training/pango/ligature_table.cpp similarity index 100% rename from src/training/ligature_table.cpp rename to src/training/pango/ligature_table.cpp diff --git a/src/training/ligature_table.h b/src/training/pango/ligature_table.h similarity index 100% rename from src/training/ligature_table.h rename to src/training/pango/ligature_table.h diff --git a/src/training/pango_font_info.cpp b/src/training/pango/pango_font_info.cpp similarity index 99% rename from src/training/pango_font_info.cpp rename to src/training/pango/pango_font_info.cpp index 999e6d1f..cd4dc027 100644 --- a/src/training/pango_font_info.cpp +++ b/src/training/pango/pango_font_info.cpp @@ -45,6 +45,8 @@ #include "pango/pangocairo.h" #include "pango/pangofc-font.h" +#define DISABLE_HEAP_LEAK_CHECK + using namespace tesseract; namespace tesseract { diff --git a/src/training/pango_font_info.h b/src/training/pango/pango_font_info.h similarity index 100% rename from src/training/pango_font_info.h rename to src/training/pango/pango_font_info.h diff --git a/src/training/stringrenderer.cpp b/src/training/pango/stringrenderer.cpp similarity index 99% rename from src/training/stringrenderer.cpp rename to src/training/pango/stringrenderer.cpp index ea087eed..0ea5bf96 100644 --- a/src/training/stringrenderer.cpp +++ b/src/training/pango/stringrenderer.cpp @@ -39,6 +39,8 @@ #include "unicode/uchar.h" // from libicu #include "util.h" +#define DISABLE_HEAP_LEAK_CHECK + namespace tesseract { static const int kDefaultOutputResolution = 300; diff --git a/src/training/stringrenderer.h b/src/training/pango/stringrenderer.h similarity index 100% rename from src/training/stringrenderer.h rename to src/training/pango/stringrenderer.h diff --git a/src/training/tlog.cpp b/src/training/pango/tlog.cpp similarity index 100% rename from src/training/tlog.cpp rename to src/training/pango/tlog.cpp diff --git a/src/training/tlog.h b/src/training/pango/tlog.h similarity index 100% rename from src/training/tlog.h rename to src/training/pango/tlog.h diff --git a/src/training/fileio.cpp b/src/training/unicharset/fileio.cpp similarity index 100% rename from src/training/fileio.cpp rename to src/training/unicharset/fileio.cpp diff --git a/src/training/fileio.h b/src/training/unicharset/fileio.h similarity index 100% rename from src/training/fileio.h rename to src/training/unicharset/fileio.h diff --git a/src/training/icuerrorcode.cpp b/src/training/unicharset/icuerrorcode.cpp similarity index 100% rename from src/training/icuerrorcode.cpp rename to src/training/unicharset/icuerrorcode.cpp diff --git a/src/training/icuerrorcode.h b/src/training/unicharset/icuerrorcode.h similarity index 100% rename from src/training/icuerrorcode.h rename to src/training/unicharset/icuerrorcode.h diff --git a/src/training/lang_model_helpers.cpp b/src/training/unicharset/lang_model_helpers.cpp similarity index 100% rename from src/training/lang_model_helpers.cpp rename to src/training/unicharset/lang_model_helpers.cpp diff --git a/src/training/lang_model_helpers.h b/src/training/unicharset/lang_model_helpers.h similarity index 100% rename from src/training/lang_model_helpers.h rename to src/training/unicharset/lang_model_helpers.h diff --git a/src/training/lstmtester.cpp b/src/training/unicharset/lstmtester.cpp similarity index 100% rename from src/training/lstmtester.cpp rename to src/training/unicharset/lstmtester.cpp diff --git a/src/training/lstmtester.h b/src/training/unicharset/lstmtester.h similarity index 100% rename from src/training/lstmtester.h rename to src/training/unicharset/lstmtester.h diff --git a/src/training/lstmtrainer.cpp b/src/training/unicharset/lstmtrainer.cpp similarity index 100% rename from src/training/lstmtrainer.cpp rename to src/training/unicharset/lstmtrainer.cpp diff --git a/src/training/lstmtrainer.h b/src/training/unicharset/lstmtrainer.h similarity index 100% rename from src/training/lstmtrainer.h rename to src/training/unicharset/lstmtrainer.h diff --git a/src/training/normstrngs.cpp b/src/training/unicharset/normstrngs.cpp similarity index 100% rename from src/training/normstrngs.cpp rename to src/training/unicharset/normstrngs.cpp diff --git a/src/training/normstrngs.h b/src/training/unicharset/normstrngs.h similarity index 100% rename from src/training/normstrngs.h rename to src/training/unicharset/normstrngs.h diff --git a/src/training/unicharset_training_utils.cpp b/src/training/unicharset/unicharset_training_utils.cpp similarity index 100% rename from src/training/unicharset_training_utils.cpp rename to src/training/unicharset/unicharset_training_utils.cpp diff --git a/src/training/unicharset_training_utils.h b/src/training/unicharset/unicharset_training_utils.h similarity index 100% rename from src/training/unicharset_training_utils.h rename to src/training/unicharset/unicharset_training_utils.h diff --git a/src/training/validate_grapheme.cpp b/src/training/unicharset/validate_grapheme.cpp similarity index 100% rename from src/training/validate_grapheme.cpp rename to src/training/unicharset/validate_grapheme.cpp diff --git a/src/training/validate_grapheme.h b/src/training/unicharset/validate_grapheme.h similarity index 100% rename from src/training/validate_grapheme.h rename to src/training/unicharset/validate_grapheme.h diff --git a/src/training/validate_indic.cpp b/src/training/unicharset/validate_indic.cpp similarity index 100% rename from src/training/validate_indic.cpp rename to src/training/unicharset/validate_indic.cpp diff --git a/src/training/validate_indic.h b/src/training/unicharset/validate_indic.h similarity index 100% rename from src/training/validate_indic.h rename to src/training/unicharset/validate_indic.h diff --git a/src/training/validate_javanese.cpp b/src/training/unicharset/validate_javanese.cpp similarity index 100% rename from src/training/validate_javanese.cpp rename to src/training/unicharset/validate_javanese.cpp diff --git a/src/training/validate_javanese.h b/src/training/unicharset/validate_javanese.h similarity index 100% rename from src/training/validate_javanese.h rename to src/training/unicharset/validate_javanese.h diff --git a/src/training/validate_khmer.cpp b/src/training/unicharset/validate_khmer.cpp similarity index 100% rename from src/training/validate_khmer.cpp rename to src/training/unicharset/validate_khmer.cpp diff --git a/src/training/validate_khmer.h b/src/training/unicharset/validate_khmer.h similarity index 100% rename from src/training/validate_khmer.h rename to src/training/unicharset/validate_khmer.h diff --git a/src/training/validate_myanmar.cpp b/src/training/unicharset/validate_myanmar.cpp similarity index 100% rename from src/training/validate_myanmar.cpp rename to src/training/unicharset/validate_myanmar.cpp diff --git a/src/training/validate_myanmar.h b/src/training/unicharset/validate_myanmar.h similarity index 100% rename from src/training/validate_myanmar.h rename to src/training/unicharset/validate_myanmar.h diff --git a/src/training/validator.cpp b/src/training/unicharset/validator.cpp similarity index 100% rename from src/training/validator.cpp rename to src/training/unicharset/validator.cpp diff --git a/src/training/validator.h b/src/training/unicharset/validator.h similarity index 100% rename from src/training/validator.h rename to src/training/unicharset/validator.h diff --git a/src/training/util.h b/src/training/util.h deleted file mode 100644 index de6ac715..00000000 --- a/src/training/util.h +++ /dev/null @@ -1,24 +0,0 @@ -/********************************************************************** - * File: util.h - * Description: Misc STL string utility functions. - * Author: Samuel Charron - * - * (C) Copyright 2013, Google Inc. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - **********************************************************************/ - -#ifndef TESSERACT_TRAINING_UTIL_H_ -#define TESSERACT_TRAINING_UTIL_H_ - -#define DISABLE_HEAP_LEAK_CHECK {} - -#endif // TESSERACT_TRAINING_UTIL_H_ diff --git a/sw.cpp b/sw.cpp index c30f5c27..3f43919e 100644 --- a/sw.cpp +++ b/sw.cpp @@ -126,27 +126,8 @@ void build(Solution &s) { common_training += "TESS_COMMON_TRAINING_API"_api; common_training += cppstd; - common_training += - "src/training/commandlineflags.cpp", - "src/training/commandlineflags.h", - "src/training/commontraining.cpp", - "src/training/commontraining.h", - "src/training/ctc.cpp", - "src/training/ctc.h", - "src/training/errorcounter.cpp", - "src/training/errorcounter.h", - "src/training/intfeaturedist.cpp", - "src/training/intfeaturedist.h", - "src/training/intfeaturemap.cpp", - "src/training/intfeaturemap.h", - "src/training/mastertrainer.cpp", - "src/training/mastertrainer.h", - "src/training/networkbuilder.cpp", - "src/training/networkbuilder.h", - "src/training/sampleiterator.cpp", - "src/training/sampleiterator.h", - "src/training/trainingsampleset.cpp", - "src/training/trainingsampleset.h"; + common_training += "src/training/common/.*"_rr; + common_training.Public += "src/training/common"_idir; common_training.Public += tessopt; } @@ -155,16 +136,8 @@ void build(Solution &s) { unicharset_training += "TESS_UNICHARSET_TRAINING_API"_api; unicharset_training += cppstd; - unicharset_training += - "src/training/fileio.*"_rr, - "src/training/icuerrorcode.*"_rr, - "src/training/icuerrorcode.h", - "src/training/lang_model_helpers.*"_rr, - "src/training/lstmtester.*"_rr, - "src/training/lstmtrainer.*"_rr, - "src/training/normstrngs.*"_rr, - "src/training/unicharset_training_utils.*"_rr, - "src/training/validat.*"_rr; + unicharset_training += "src/training/unicharset/.*"_rr; + unicharset_training.Public += "src/training/unicharset"_idir; unicharset_training.Public += common_training; unicharset_training.Public += "org.sw.demo.unicode.icu.i18n"_dep; } @@ -197,18 +170,8 @@ void build(Solution &s) { pango_training += "TESS_PANGO_TRAINING_API"_api; pango_training += cppstd; - pango_training += - "src/training/boxchar.cpp", - "src/training/boxchar.h", - "src/training/ligature_table.cpp", - "src/training/ligature_table.h", - "src/training/pango_font_info.cpp", - "src/training/pango_font_info.h", - "src/training/stringrenderer.cpp", - "src/training/stringrenderer.h", - "src/training/tlog.cpp", - "src/training/tlog.h" - ; + pango_training += "src/training/pango/.*"_rr; + pango_training.Public += "src/training/pango"_idir; pango_training.Public += unicharset_training; pango_training.Public += "org.sw.demo.gnome.pango.pangocairo"_dep; }