14
14
#ifndef TESSERACT_TRAINING_COMMONTRAINING_H__
15
15
#define TESSERACT_TRAINING_COMMONTRAINING_H__
18
17
#include "cluster.h"
18
#include "commandlineflags.h"
19
20
#include "intproto.h"
22
// Macros to merge tesseract params with command-line flags.
23
#ifdef USE_STD_NAMESPACE
25
# define INT_PARAM_FLAG(name, val, comment) \
26
INT_VAR(FLAGS_##name, val, comment)
27
# define DECLARE_INT_PARAM_FLAG(name) extern INT_VAR_H(FLAGS_##name, 0, "")
28
# define STRING_PARAM_FLAG(name, val, comment) \
29
STRING_VAR(FLAGS_##name, val, comment)
30
# define DECLARE_STRING_PARAM_FLAG(name) \
31
extern STRING_VAR_H(FLAGS_##name, "", "")
34
#include "base/commandlineflags.h"
35
# define INT_PARAM_FLAG(name, val, comment) \
36
DEFINE_int32(name, val, comment)
37
# define DECLARE_INT_PARAM_FLAG(name) DECLARE_int32(name)
38
# define STRING_PARAM_FLAG(name, val, comment) \
39
DEFINE_string(name, val, comment)
40
# define DECLARE_STRING_PARAM_FLAG(name) DECLARE_string(name)
43
23
namespace tesseract {
82
62
void ParseArguments(int* argc, char*** argv);
84
64
namespace tesseract {
85
66
// Helper loads shape table from the given file.
86
67
ShapeTable* LoadShapeTable(const STRING& file_prefix);
87
68
// Helper to write the shape_table.