Would it be possible to add to the APIexample
<https://github.com/tesseract-ocr/tesseract/wiki/APIExample> wiki on how to
accomplish the equivalent of tesseract --list-langs and tesseract
--print-parameters via the API?
To list languages I currently use something like the following. However the
problem is that I first need to initialize the english engine which might
not be available. Is there a way to list languages without initializing any
engine?
tesseract::TessBaseAPI *api = new tesseract::TessBaseAPI();
if (api->Init(NULL, "eng"))
throw std::runtime_error(std::string("Unable to find training data for"));
api->GetAvailableLanguagesAsVector(langs);
std::vector<std::string> available;
for(int i = 0; i < langs->length(); i++)
available.push_back(langs->get(i).c_str());
The only method I can find in the base API to list supported parameters is:
api->PrintVariables(stdout);
However this prints a text dump which is difficult to read by machines. Is
there an api to iterate over the supported variables strings and stick them
into a std::vector<std::string> ?
--
You received this message because you are subscribed to the Google Groups
"tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tesseract-ocr/c3442180-6b7b-41f0-9b98-b070583c354f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.