Tesseract traineddata not working in Swift 3.0 project using version 4.0
<p>I'm attempting to use <a href="https://github.com/gali8/Tesseract-OCR-iOS" rel="noreferrer">Tesseract-OCR-iOS</a> in a new Swift 3.0 project. I'm using Xcode Version 8.1 (8B62). CocoaPods is version 1.1.1. </p>

<p>When I attempt to use <code>tesseract.recognize()</code>, my app crashes and I get the following output in the console:</p>

<pre><code>actual_tessdata_num_entries_ &lt;= TESSDATA_NUM_ENTRIES:Error:Assert failed:in file tessdatamanager.cpp, line 53
</code></pre>

<p>I found <a href="https://github.com/tesseract-ocr/tesseract/wiki/FAQ#actual_tessdata_num_entries_-tessdata_num_entrieserrorassert-failedin-file-ccutiltessdatamanagercpp-line-55_" rel="noreferrer">this post</a>, which sounds I'm using the wrong version of <code>traineddata</code>. I downloaded <code>tessdata</code> from <a href="https://github.com/tesseract-ocr/tessdata" rel="noreferrer">the tesseract-ocr/tessdata repo</a>, so I'm baffled as to why I'd have a mismatch on the version numbers.</p>

<p>Any suggestions how to get Tesseract working are greatly appreciated. Below is additional information re: my setup.</p>

<p>Here's what my <code>Podfile</code> looks like:</p>

<pre><code># Uncomment the next line to define a global platform for your project
platform :ios, '9.0'

target 'TesseractDemo' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for TesseractDemo
pod 'TesseractOCRiOS', '4.0.0'

end
</code></pre>

<p>I've dragged a <code>tessdata</code> folder containing <code>eng.traineddata</code> into the root directory of my project outside of Xcode and dragged a <strong>reference</strong> from Finder to Xcode's Project Navigator.</p>

<p>Everything works fine up to this point. No compiler errors, linker whining, etc. In a <code>UIViewController</code> I'm importing <code>TesseratOCR</code> and calling it like so:</p>

<pre><code>// MARK: - OCR Methods
func scanImage(image: UIImage) {
    if let tesseract = G8Tesseract(language: "eng") {
        tesseract.delegate = self
        tesseract.image = imageToScan?.g8_blackAndWhite()
        tesseract.recognize()

        textView.text = tesseract.recognizedText
    }
}
</code></pre>

<p><strong>Update</strong>
I found a link to a <a href="https://github.com/tesseract-ocr/tesseract/wiki/Data-Files#data-files-for-version-400" rel="noreferrer">repo of traineddata files for <strong>version 4.0</strong></a>. I nuked my old eng.traineddata file and replaced it with the one from the 4.0 repo. I get the same error referencing the same line.</p>