Would it be possible to add to the 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> ?
Is there a way to list languages without initializing any engine?
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>?