21 #ifdef GOOGLE_TESSERACT 22 #include "base/commandlineflags.h" 23 #endif // GOOGLE_TESSERACT 43 static const char* names[] = {
"pruner",
"full"};
46 const char* classifer_name,
const UNICHARSET& unicharset,
47 int argc,
char **argv,
52 if (strcmp(classifer_name, names[c]) == 0) {
58 fprintf(stderr,
"Invalid classifier name:%s\n", FLAGS_classifier.c_str());
69 if ((*api)->Init(FLAGS_tessdata_dir.c_str(), FLAGS_lang.c_str(),
71 fprintf(stderr,
"Tesseract initialization failed!\n");
77 fprintf(stderr,
"Tesseract must contain a ShapeTable!\n");
85 }
else if (classifier ==
CN_FULL) {
88 tprintf(
"Testing classifier %s:\n", classifer_name);
89 return shape_classifier;
111 int main(
int argc,
char **argv) {
112 tesseract::CheckSharedLibraryVersion();
120 FLAGS_classifier.c_str(), trainer->
unicharset(), argc, argv, &api);
121 if (shape_classifier ==
nullptr) {
122 fprintf(stderr,
"Classifier init failed!:%s\n", FLAGS_classifier.c_str());
132 std::max(3, static_cast<int>(FLAGS_debug_level)),
false,
133 shape_classifier,
nullptr);
134 delete shape_classifier;
const UNICHARSET & unicharset() const
struct TessBaseAPI TessBaseAPI
STRING_PARAM_FLAG(classifier, "", "Classifier to test")
void ParseArguments(int *argc, char ***argv)
void TestClassifierOnSamples(CountTypes error_mode, int report_level, bool replicate_samples, ShapeClassifier *test_classifier, STRING *report_string)
int main(int argc, char **argv)
void ReplicateAndRandomizeSamplesIfRequired()
DECLARE_INT_PARAM_FLAG(debug_level)
DLLSYM void tprintf(const char *format,...)
const ShapeTable * shape_table() const
MasterTrainer * LoadTrainingData(int argc, const char *const *argv, bool replication, ShapeTable **shape_table, STRING *file_prefix)