#include <stdio.h>
#include "baseapi.h"
#include "helpers.h"
#include "strngs.h"
#include "dict.h"
#include "tesseractclass.h"
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
This program reads in a text file consisting of feature samples from a training page in the following format:
FontName UTF8-char-str xmin ymin xmax ymax page-number
NumberOfFeatureTypes(N)
FeatureTypeName1 NumberOfFeatures(M)
Feature1
...
FeatureM
FeatureTypeName2 NumberOfFeatures(M)
Feature1
...
FeatureM
...
FeatureTypeNameN NumberOfFeatures(M)
Feature1
...
FeatureM
FontName CharName ...
The result of this program is a binary inttemp file used by the OCR engine.
- Parameters
-
argc | number of command line arguments |
argv | array of command line arguments |
- Returns
- none
- Note
- Exceptions: none
-
History: Fri Aug 18 08:56:17 1989, DSJ, Created.
-
History: Mon May 18 1998, Christy Russson, Revistion started.
Definition at line 32 of file ambiguous_words.cpp.
35 if (argc != 4 && (argc != 6 || strcmp(argv[1],
"-l") != 0)) {
36 printf(
"Usage: %s [-l lang] tessdata_dir wordlist_file"
37 " output_ambiguious_wordlist_file\n", argv[0]);
48 const char *tessdata_dir = argv[++argv_offset];
49 const char *input_file_str = argv[++argv_offset];
50 const char *output_file_str = argv[++argv_offset];
56 vars_vec.
push_back(
"output_ambig_words_file");
59 NULL, 0, &vars_vec, &vars_values,
false);
61 FILE *input_file = fopen(input_file_str,
"rb");
62 if (input_file == NULL) {
63 tprintf(
"Failed to open input wordlist file %s\n", input_file_str);
Tesseract *const tesseract() const
void chomp_string(char *str)
bool NoDangerousAmbig(WERD_CHOICE *BestChoice, DANGERR *fixpt, bool fix_replaceable, MATRIX *ratings)
int Init(const char *datapath, const char *language, OcrEngineMode mode, char **configs, int configs_size, const GenericVector< STRING > *vars_vec, const GenericVector< STRING > *vars_values, bool set_only_non_debug_params)
const UNICHARSET & getUnicharset() const
const char * string() const