Search code examples
androidbashcygwintess-two

Android Tess-two: library configuration using cygwin


i am following this tutorial here to use Tesseract libs for android. and in step(b) in the link posted, it says: b.export TESSERACT_PATH=${PWD}/external/tesseract-3.01

and in cygwin i wrote the following:

dm@me /cygdrive/e/Data/private/Fr/OCR/libs/tess-two-
master/tess-two-master/tess-two

but when i execute it i receive the belwo error:

 $ export C:\Program Files (x86)\Tesseract-OCR=${PWD}\external\tesseract-3.01
-bash: syntax error near unexpected token `('

please let me know how to fix it, as i am a beginner to cygwin.

update:

i tried ezrepotein4 answer, and now it gives me "not a valid identifier". please , let me know what is "external\tesseract-3.01", i do not have these files/folders...and what is PWD. thanks


Solution

  • In this tutorial author uses few linux commands:

    • cd which changes directory - it is an equevalent of windows dir
    • export which sets environment variable

    Before exporting any variable you should change directory to your project dir, because all $PWD strings in further commands will be replaced by your current directory.

    This tutorial assumes that you compiled tesseract and leptonica and you keep them in project-dir/tess-two/external directory as tesseract-3.01 and leptonica-1.68. Source code for those libraries are in tess-two/jni directory in repository as stated in README.md https://github.com/rmtheis/tess-two/blob/master/README.md

    Code which you are trying yo execute is incorrect both syntactically and semantically. It is incorrect syntactically because you all spaces are treated as separators between arguments. Semantically you are trying to set variable C:\Program Files (x86)\Tesseract-OCR to value of ${PWD}\external\tesseract-3.01. Instead you should set TESSERACT_PATH variable.

    To do this try command TESSERACT_PATH=${PWD}/external/tesseract-3.01 as stated in tutorial. This means that you are setting variable TESSERACT_PATH to folder external/tesseract-3.01 in your current dir.

    To further inspect a value of this variable type: echo $TESSERACT_PATH.