Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Init Only Variables #68

Closed
stuartthomas25 opened this issue Nov 30, 2014 · 3 comments
Closed

Init Only Variables #68

stuartthomas25 opened this issue Nov 30, 2014 · 3 comments

Comments

@stuartthomas25
Copy link

Tesseract OCR iOS is unable to set "Init Only" variables like user_words_suffix and load_system_dawg (see https://code.google.com/p/tesseract-ocr/wiki/ControlParams). I recommend a method

  • (id)initWithVariables:(NSDictionary*)parameters language:(NSString *)language;
    where "parameters" is a key-value dictionary describing init-only parameters and their values.
@kevincon
Copy link
Collaborator

kevincon commented Dec 2, 2014

+1. I think this is something the library really needs (it was also indirectly asked for in #45).

Among other things, it would let users provide a file with regexes for specific patterns Tesseract should try to recognize (e.g. license plates, phone numbers, etc.).

I looked into adding support for this myself a while back, and this is the relevant C++ function to call http://zdenop.github.io/tesseract-doc/classtesseract_1_1_tess_base_a_p_i.html#a96899e8e5358d96752ab1cfc3bc09f3e, but I got confused about how to map the C++ types to Objective C types. Anyway, this is where we currently call Init() in the code, but we're calling an overloaded version with fewer arguments: https://github.com/gali8/Tesseract-OCR-iOS/blob/master/TesseractOCR/Tesseract.mm#L119. For inspiration, this is how the actual tesseract binary calls Init() with parameters: https://code.google.com/p/tesseract-ocr/source/browse/api/tesseractmain.cpp#180

School gets out in two weeks, so I'll try to take a look at adding support for this then, but anyone else should feel free to take a crack at it too.

@zachberger
Copy link
Collaborator

I'm doing some development over on my branch called init. b61b974 is my first swing at an implementation, but it still needs testing.

The next step in creating API parity after having the variables configurable at runtime in-code, is to have the variables stored in a config file.

@kevincon
Copy link
Collaborator

kevincon commented Jan 4, 2015

Implemented by #113.

@kevincon kevincon closed this as completed Jan 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants