Tesseract - change language file location

sydd picture sydd · Aug 5, 2011 · Viewed 19.2k times · Source

I am making an AIR project, which will need some OCR capabilities, so i decided to use tesseract (now i try to get it working on Windows).

My problem is, that can not change the location of the language file - it always tries to look in my Tesseract installation directory (program files (x86)\Tesseract-OCR\tessdata\mylang.traineddata)

Is there a way that i can configure Tesseract to look for this file where i specify? for example in the same folder as tesseract.exe. I dont want (or perhaps event cant) install an application with the AIR installer. I've tried it with the 3.0 version and the latest SVN version.

Thanks

Answer

nguyenq picture nguyenq · Aug 5, 2011

Yes, you can, by setting the TESSDATA_PREFIX environment variable, e.g.:

export TESSDATA_PREFIX=/usr/local/share/

Note that the directory path must end in a /.