41 {
42
43
44
45
46
47
48
49
50 tesseract::CheckSharedLibraryVersion();
52
53
57
59 if (!unicharset.
load_from_file(FLAGS_input_unicharset.c_str(),
false)) {
60 tprintf(
"Failed to load unicharset from %s\n", FLAGS_input_unicharset.c_str());
61 return EXIT_FAILURE;
62 }
63 tprintf(
"Loaded unicharset of size %zu from file %s\n", unicharset.
size(),
64 FLAGS_input_unicharset.c_str());
65
66
67 tprintf(
"Setting unichar properties\n");
69 false, &unicharset);
70 tprintf(
"Setting script properties\n");
72
74 FLAGS_version_str.c_str(), FLAGS_output_dir.c_str(),
75 FLAGS_lang.c_str(), FLAGS_pass_through_recoder, words, puncs,
76 numbers, FLAGS_lang_is_rtl, nullptr,
77 nullptr);
78}
void ParseCommandLineFlags(const char *usage, int *argc, char ***argv, const bool remove_flags)
void tprintf(const char *format,...)
void SetupBasicProperties(bool report_errors, bool decompose, UNICHARSET *unicharset)
void SetScriptProperties(const std::string &script_dir, UNICHARSET *unicharset)
std::string ReadFile(const std::string &filename, FileReader reader)
int CombineLangModel(const UNICHARSET &unicharset, const std::string &script_dir, const std::string &version_str, const std::string &output_dir, const std::string &lang, bool pass_through_recoder, const std::vector< std::string > &words, const std::vector< std::string > &puncs, const std::vector< std::string > &numbers, bool lang_is_rtl, FileReader reader, FileWriter writer)
const std::vector< std::string > split(const std::string &s, char c)
bool load_from_file(const char *const filename, bool skip_fragments)