gali8 / Tesseract-OCR-iOS

Tesseract OCR iOS is a Framework for iOS7+, compiled also for armv7s and arm64.
http://www.nexor.it
MIT License
4.22k stars 949 forks source link

Initializing G8Tesseract from a different bundle #263

Open jowie opened 8 years ago

jowie commented 8 years ago

I have a project where I need to use G8Tesseract from within a nested project as a framework. Unfortunately it looks as though I can only pass in a language name, and G8Tesseract looks for the traineddata file associated with that language from within the main bundle.

How can I override this behaviour so it can be pulled from a different bundle? I was looking into using your configFileNames in the initializer, but from the looks of it that's just for config stuff and not for the traineddata file?

ws233 commented 8 years ago

@ jowie, it's very easy. Just make a child of G8Tesseract and reimplement init methods as you need. Is it an answer for your question? If so, pls, close the ticket. Thanks!

jowie commented 8 years ago

Hi @ws233 what do you mean reimplement init methods? I need a way of passing in a traineddata file that doesn't sit within the main bundle. Is there a way of doing this? Thanks!