31 FILE *dawg_file = fopen(
filename,
"rb");
32 if (dawg_file == NULL) {
48 void output_word(
const char *word) { fprintf(file_,
"%s\n", word); }
56 const char *outfile_name) {
57 FILE *out = fopen(outfile_name,
"wb");
59 tprintf(
"Could not open %s for writing.\n", outfile_name);
70 int main(
int argc,
char *argv[]) {
72 tprintf(
"Print all the words in a given dawg.\n");
73 tprintf(
"Usage: %s <unicharset> <dawgfile> <wordlistfile>\n",
77 const char *unicharset_file = argv[1];
78 const char *dawg_file = argv[2];
79 const char *wordlist_file = argv[3];
82 tprintf(
"Error loading unicharset from %s.\n", unicharset_file);
87 tprintf(
"Error loading dictionary from %s.\n", dawg_file);
const int kDictDebugLevel
_ConstTessMemberResultCallback_0_0< false, R, T1 >::base * NewPermanentTessCallback(const T1 *obj, R(T2::*member)() const)
WordOutputter(FILE *file)
void iterate_words(const UNICHARSET &unicharset, TessCallback1< const WERD_CHOICE *> *cb) const
tesseract::Dawg * LoadSquishedDawg(const UNICHARSET &unicharset, const char *filename)
void output_word(const char *word)
bool load_from_file(const char *const filename, bool skip_fragments)
int WriteDawgAsWordlist(const UNICHARSET &unicharset, const tesseract::Dawg *dawg, const char *outfile_name)
int main(int argc, char *argv[])