33 if (!dawg_file.
Open(filename,
nullptr)) {
34 tprintf(
"Could not open %s for reading.\n", filename);
37 tprintf(
"Loading word list from %s\n", filename);
40 if (!retval->
Load(&dawg_file)) {
41 tprintf(
"Could not read %s\n", filename);
52 void output_word(
const char *word) { fprintf(file_,
"%s\n", word); }
60 const char *outfile_name) {
61 FILE *out = fopen(outfile_name,
"wb");
63 tprintf(
"Could not open %s for writing.\n", outfile_name);
74 int main(
int argc,
char *argv[]) {
76 tprintf(
"Print all the words in a given dawg.\n");
77 tprintf(
"Usage: %s <unicharset> <dawgfile> <wordlistfile>\n",
81 const char *unicharset_file = argv[1];
82 const char *dawg_file = argv[2];
83 const char *wordlist_file = argv[3];
86 tprintf(
"Error loading unicharset from %s.\n", unicharset_file);
90 if (dict ==
nullptr) {
91 tprintf(
"Error loading dictionary from %s.\n", dawg_file);
_ConstTessMemberResultCallback_0_0< false, R, T1 >::base * NewPermanentTessCallback(const T1 *obj, R(T2::*member)() const)
void output_word(const char *word)
tesseract::Dawg * LoadSquishedDawg(const UNICHARSET &unicharset, const char *filename)
int WriteDawgAsWordlist(const UNICHARSET &unicharset, const tesseract::Dawg *dawg, const char *outfile_name)
void iterate_words(const UNICHARSET &unicharset, TessCallback1< const WERD_CHOICE *> *cb) const
const int kDictDebugLevel
int main(int argc, char *argv[])
WordOutputter(FILE *file)
bool load_from_file(const char *const filename, bool skip_fragments)
bool Open(const STRING &filename, FileReader reader)