Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lex failed with exit code 1

I am trying to include a file in my resource bundle the files contains the following:

LeadPunc="({[`'
TrailPunc=}:;-]!?`,.)"'
NumLeadPunc=#({[@$
NumTrailPunc=}):;].,%
Operators=*+-/.:,()[]
Digits=0123456789
Alphas=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
*extra line*

The files is called:

eng.cube.lm

The error I get is:

IExpenseReporter/tessdata/eng.cube.lm:6: premature EOF
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lex failed with exit code 1

This file goes along with the newest version of tesseract (OCR). Does anyone have an idea what is causing this error and how to fix it?

like image 931
Alex Pelletier Avatar asked Dec 01 '13 07:12

Alex Pelletier


2 Answers

Make sure you select the "Create folder references" option when adding the tessdata folder to your project.

From the documentation:

NOTE: This library currently requires the tessdata folder to be linked as a referenced folder instead of a symbolic group. If Tesseract can't find a language file in your own project, it's probably because you created the tessdata folder as a symbolic group instead of a referenced folder. It should look like this if you did it correctly:

enter image description here

Note how the tessdata folder has a blue icon, indicating it was imported as a referenced folder instead of a symbolic group.

Trashing the current folder and adding it again as a folder reference should solve the problem.

like image 93
kanstraktar Avatar answered Oct 21 '22 10:10

kanstraktar


XCode "thinks" this is a lex file and try to process it by calling lex. However, lex finds and unbalanced quote and thus a premature end of file.

You should try to call the designated tool explicitly.

like image 28
Matthias Avatar answered Oct 21 '22 11:10

Matthias