42 {
43
44
45
46
47
48
49
50
51 tesseract::CheckSharedLibraryVersion();
53
55
59
61 if (!unicharset.
load_from_file(FLAGS_input_unicharset.c_str(),
false)) {
62 tprintf(
"Failed to load unicharset from %s\n",
63 FLAGS_input_unicharset.c_str());
64 return 1;
65 }
66 tprintf(
"Loaded unicharset of size %d from file %s\n", unicharset.
size(),
67 FLAGS_input_unicharset.c_str());
68
69
70 tprintf(
"Setting unichar properties\n");
72 false, &unicharset);
73 tprintf(
"Setting script properties\n");
75
77 unicharset, FLAGS_script_dir.c_str(), FLAGS_version_str.c_str(),
78 FLAGS_output_dir.c_str(), FLAGS_lang.c_str(), FLAGS_pass_through_recoder,
79 words, puncs, numbers, FLAGS_lang_is_rtl, nullptr,
80 nullptr);
81}
DLLSYM void tprintf(const char *format,...)
void ParseCommandLineFlags(const char *usage, int *argc, char ***argv, const bool remove_flags)
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 GenericVector< STRING > &words, const GenericVector< STRING > &puncs, const GenericVector< STRING > &numbers, bool lang_is_rtl, FileReader reader, FileWriter writer)
void SetScriptProperties(const std::string &script_dir, UNICHARSET *unicharset)
void SetupBasicProperties(bool report_errors, bool decompose, UNICHARSET *unicharset)
STRING ReadFile(const std::string &filename, FileReader reader)
void split(char c, GenericVector< STRING > *splited)
bool load_from_file(const char *const filename, bool skip_fragments)