Skip to content
This repository has been archived by the owner on Mar 17, 2022. It is now read-only.

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit f465360
Author: Robert Theis <[email protected]>
Date:   Fri Apr 20 07:24:09 2018 -0700

    Edit change log

commit 6aa9dc7
Author: Robert Theis <[email protected]>
Date:   Fri Apr 20 07:17:42 2018 -0700

    Edit change log

commit ce13d6f
Author: Robert Theis <[email protected]>
Date:   Thu Apr 19 20:56:55 2018 -0700

    Update change log

commit 35d3569
Author: Robert Theis <[email protected]>
Date:   Thu Apr 19 20:13:58 2018 -0700

    Set version to 9.0.0

commit 3b7e544
Author: Robert Theis <[email protected]>
Date:   Thu Apr 19 20:00:01 2018 -0700

    Fix 64-bit issues. Closes #197.

commit 229906e
Author: Robert Theis <[email protected]>
Date:   Thu Apr 19 19:01:38 2018 -0700

    Fix null check

commit 6509ff4
Author: Robert Theis <[email protected]>
Date:   Thu Apr 19 18:38:45 2018 -0700

    Add missing includes

commit 4a4bc77
Author: Robert Theis <[email protected]>
Date:   Thu Apr 19 17:51:19 2018 -0700

    Update dependency versions

commit 0766501
Author: Robert Theis <[email protected]>
Date:   Thu Apr 19 17:41:17 2018 -0700

    Mute libjpeg build warning

commit 5c0b8e3
Author: Robert Theis <[email protected]>
Date:   Thu Apr 19 17:17:49 2018 -0700

    Update documentation

commit e2bea65
Author: Robert Theis <[email protected]>
Date:   Thu Apr 19 16:44:51 2018 -0700

    Catch Arabic/Hindi init misconfigurations. Closes #240.

commit b0f3c2c
Author: Robert Theis <[email protected]>
Date:   Thu Apr 19 13:40:38 2018 -0700

    Edit ABI targets

commit 4661d8e
Author: Robert Theis <[email protected]>
Date:   Thu Apr 19 12:45:51 2018 -0700

    Minor edit to Gradle config

commit 3436f01
Merge: 14fa90a a5fac7d
Author: Robert Theis <[email protected]>
Date:   Wed Jan 17 17:12:42 2018 -0800

    Merge pull request #233 from mauriciotogneri/master

    Updated repositories. Changed compile to implementation.

commit a5fac7d
Author: mtogneri <[email protected]>
Date:   Sat Jan 6 17:57:13 2018 +0100

    Updated repositories. Changed compile to implementation.

commit 14fa90a
Merge: d85ef2d ce84fcd
Author: Robert Theis <[email protected]>
Date:   Thu Dec 28 20:28:25 2017 -0800

    Merge pull request #231 from mauriciotogneri/master

    Updated version of SDK, build tools and support libraries

commit ce84fcd
Author: Mauricio Togneri <[email protected]>
Date:   Fri Dec 15 10:19:15 2017 +0100

    Updated version of SDK, build tools and support libraries

commit d85ef2d
Author: Robert Theis <[email protected]>
Date:   Thu Sep 7 21:46:50 2017 -0700

    Add support annotations

commit 52be81e
Author: Robert Theis <[email protected]>
Date:   Sat Aug 12 20:10:17 2017 -0700

    Update change log

commit d5849be
Author: Robert Theis <[email protected]>
Date:   Sat Aug 12 19:17:18 2017 -0700

    Set version to 8.0.0

commit 688d487
Author: Robert Theis <[email protected]>
Date:   Sat Aug 12 19:17:04 2017 -0700

    Don't build 64-bit ABIs by default

commit ab9b9a3
Author: Robert Theis <[email protected]>
Date:   Sat Jul 22 14:32:20 2017 -0700

    Update readme

commit 5a1e4e2
Author: Robert Theis <[email protected]>
Date:   Wed Jun 28 07:22:16 2017 -0700

    Update Github issue template

commit b57e6af
Merge: 1632130 2dc4ac4
Author: Robert Theis <[email protected]>
Date:   Fri Jun 16 06:37:05 2017 -0700

    Merge pull request #217 from ivankolev/master

    clone tag 3.04.00 from tessdata

commit 2dc4ac4
Author: ivankolev <[email protected]>
Date:   Thu Jun 15 21:06:06 2017 -0400

    clone tag 3.04.00 from tessdata, as master now contains traineddata files for tesseract 4, notably it does not contain eng.cube.* files

commit 1632130
Merge: dafeb3c d727e0c
Author: Robert Theis <[email protected]>
Date:   Wed Jun 14 07:53:18 2017 -0700

    Merge pull request #216 from ivankolev/master

    See issue #215

commit d727e0c
Merge: b4066f1 dafeb3c
Author: ivankolev <[email protected]>
Date:   Tue Jun 13 18:19:09 2017 -0400

    Merge remote-tracking branch 'original-origin/master'

commit dafeb3c
Author: Robert Theis <[email protected]>
Date:   Mon Jun 12 21:25:03 2017 -0700

    Update .gitignore

commit 0bb3eb5
Author: Robert Theis <[email protected]>
Date:   Mon Jun 12 21:23:54 2017 -0700

    Update Gradle plugin

commit a00479b
Author: Robert Theis <[email protected]>
Date:   Mon Jun 12 20:47:15 2017 -0700

    Update change log

commit 686a681
Author: Robert Theis <[email protected]>
Date:   Mon Jun 12 20:09:03 2017 -0700

    Set version to 7.0.0

commit b4066f1
Author: ivankolev <[email protected]>
Date:   Mon Jun 12 18:20:48 2017 -0400

    add header files explicitly so "gradlew assemble" could finish successfully

commit fa9c178
Author: Robert Theis <[email protected]>
Date:   Wed May 17 19:59:07 2017 -0700

    Improve data path used for testing. Closes #208.

commit cc75026
Merge: aa4933b 65a5987
Author: Robert Theis <[email protected]>
Date:   Mon May 15 22:32:02 2017 -0400

    Merge pull request #209 from Robyer/fixPageSegMode

    Add missing PageSegMode constant

commit 65a5987
Author: Robert Pösel <[email protected]>
Date:   Mon May 15 12:59:10 2017 +0200

    Remove PSM_COUNT constant

    It is useless to have this in Java API.

commit 4c75483
Author: Robert Pösel <[email protected]>
Date:   Mon May 15 12:50:57 2017 +0200

    Add missing PSM_RAW_LINE mode

    It was added in Tesseract v3.04

commit aa4933b
Author: Robert Theis <[email protected]>
Date:   Sun May 14 13:19:33 2017 -0700

    Minor update to Javadoc for ResultIterator

commit ba06c7e
Merge: 43c52fe bfe2bcf
Author: Robert Theis <[email protected]>
Date:   Sun May 14 15:52:54 2017 -0400

    Merge pull request #206 from Robyer/improveResultIterator

    Improve ResultIterator

commit 43c52fe
Author: Robert Theis <[email protected]>
Date:   Sun May 14 12:05:54 2017 -0700

    Update test to check BeginDocument return value

commit 615586c
Merge: 98995d4 00d093d
Author: Robert Theis <[email protected]>
Date:   Sun May 14 15:04:33 2017 -0400

    Merge pull request #207 from Robyer/fixBeginDocument

    Fix return value of BeginDocument (fixes #103)

commit 98995d4
Merge: 3bda8b1 939b96e
Author: Robert Theis <[email protected]>
Date:   Sun May 14 14:11:32 2017 -0400

    Merge pull request #205 from Robyer/updateGradlePlugin

    Update gradle plugin

commit 00d093d
Author: Robert Pösel <[email protected]>
Date:   Thu May 11 04:52:56 2017 +0200

    Fix return value of BeginDocument (fixes #103)

    pdfRenderer->BeginDocument return true on success so the condition was wrongly inverted. This commit fixes that and uses a bit cleaner code.

commit bfe2bcf
Author: Robert Pösel <[email protected]>
Date:   Thu May 11 03:59:49 2017 +0200

    Fix typo in nativeDelete method

commit 56203ad
Author: Robert Pösel <[email protected]>
Date:   Thu May 11 04:39:52 2017 +0200

    ResultIterator: Add IsAtBeginningOf and IsAtFinalElement methods

commit 506d004
Author: Robert Pösel <[email protected]>
Date:   Thu May 11 03:35:19 2017 +0200

    Fix static native method parameter

commit bdd2fe7
Author: Robert Pösel <[email protected]>
Date:   Thu May 11 03:06:03 2017 +0200

    Fix size of string holding symbol and confidence

    We're printing "%s|%.2f" which could end up in "%s|100.00" so it's "strlen(utfText) + 7".

commit af9fc83
Author: Robert Pösel <[email protected]>
Date:   Thu May 11 03:01:17 2017 +0200

    ResultIterator can't return choices with custom level (closes #119)

    ChoicesIterator always return only list of alternatives of symbol, it doesn't let us specify different PageIteratorLevel here. So this commit removes the method parameter and renames the whole method to make more sense.

commit 939b96e
Author: Robert Pösel <[email protected]>
Date:   Thu May 11 02:51:57 2017 +0200

    Update gradle plugin

commit 3bda8b1
Merge: 3debecf 7792a02
Author: Robert Theis <[email protected]>
Date:   Thu Apr 27 07:12:34 2017 -0700

    Merge pull request #202 from Robyer/fixJavadocs

    Fix javadocs errors and warnings

commit 7792a02
Author: Robert Pösel <[email protected]>
Date:   Thu Apr 27 08:27:01 2017 +0200

    Fix javadocs errors and warnings
  • Loading branch information
rmtheis committed Aug 12, 2018
1 parent 995fb5e commit e9c7aaa
Show file tree
Hide file tree
Showing 35 changed files with 386 additions and 163 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ build/
.idea/
*.iml
javadoc/
tessdata/
41 changes: 31 additions & 10 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,20 @@ AAR as an external dependency in your app project. To start the build, import
the root directory of this project into Android Studio as an existing Android
Studio project, or follow the instructions below to build on the command line.

Note: When building from Android Studio, you may need to set the path to your
NDK installation in the Project Structure dialog (File->Project Structure).

## _Android Studio and Gradle_
## _Building with Android Studio_

The Gradle build uses the gradle-stable plugin and the Android NDK to
build the Tesseract and Leptonica native C/C++ code through a call to
`ndk-build` in `build.gradle`. After building, the AAR file that is generated
may be [imported][aar-import] into your app project as a dependency on a local
binary package.
`ndk-build` in `build.gradle`. In Android Studio, use

Build -> Rebuild Project

to build or rebuild the project.

Note: When building from Android Studio, you may need to set the path to your
NDK installation in the Project Structure dialog (File->Project Structure).

To build the project from the command line:
## _Building on the Command Line_

_On Mac/Linux:_

Expand Down Expand Up @@ -44,7 +46,20 @@ Run the following commands:
cd tess
gradlew assemble

### Testing
# Importing

After building, the code that is generated may be imported into your app
project in Android Studio as a module using

File -> New -> Import Module -> `tess-two` folder

and then adding the dependency to your app module build.gradle:

dependencies {
implementation project(':tess-two')
}

# Testing

_On Mac/Linux:_

Expand All @@ -58,4 +73,10 @@ _On Windows:_

Note that some tests will fail due to existing issues.

[aar-import]:http://stackoverflow.com/a/28816265/667810
# Removing

If you want to remove your app's dependency on the tess-two module, reverse
the import process by removing the module using the Project Structure dialog
(File->Project Structure), manually deleting the tess-two subfolder from your
app project folder, and removing the tess-two reference from your app module
build.gradle.
63 changes: 62 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,68 @@
# Change Log

## [Unreleased](https://github.com/rmtheis/tess-two/tree/HEAD)
[Full Changelog](https://github.com/rmtheis/tess-two/compare/6.3.0...HEAD)
[Full Changelog](https://github.com/rmtheis/tess-two/compare/9.0.0...HEAD)

## [9.0.0](https://github.com/rmtheis/tess-two/tree/9.0.0) (2018-04-20)
[Full Changelog](https://github.com/rmtheis/tess-two/compare/8.0.0...9.0.0)

**Change:**

- This version fixes and adds back in the 64-bit ABIs, and removes the deprecated armv5 and mips/mips64 ABIs.

**Implemented enhancements:**

- Improve developer support for Hindi/Arabic [\#240](https://github.com/rmtheis/tess-two/issues/240)

**Fixed bugs:**

- Crashing reported on 64-bit devices [\#197](https://github.com/rmtheis/tess-two/issues/197)

**Merged pull requests:**

- Updated repositories. Changed compile to implementation. [\#233](https://github.com/rmtheis/tess-two/pull/233) ([mauriciotogneri](https://github.com/mauriciotogneri))
- Updated version of SDK, build tools and support libraries [\#231](https://github.com/rmtheis/tess-two/pull/231) ([mauriciotogneri](https://github.com/mauriciotogneri))

## [8.0.0](https://github.com/rmtheis/tess-two/tree/8.0.0) (2017-08-13)
[Full Changelog](https://github.com/rmtheis/tess-two/compare/7.0.0...8.0.0)

**Change:**

- This version removes the 64-bit ABIs from the default build in order to avoid crashes due to [\#197](https://github.com/rmtheis/tess-two/issues/197)

**Closed issues:**

- Build failure with Android Studio 3 and NDK ver. 15.x [\#215](https://github.com/rmtheis/tess-two/issues/215)

**Merged pull requests:**

- clone tag 3.04.00 from tessdata [\#217](https://github.com/rmtheis/tess-two/pull/217) ([ivankolev](https://github.com/ivankolev))
- See issue \#215 [\#216](https://github.com/rmtheis/tess-two/pull/216) ([ivankolev](https://github.com/ivankolev))

## [7.0.0](https://github.com/rmtheis/tess-two/tree/7.0.0) (2017-06-12)
[Full Changelog](https://github.com/rmtheis/tess-two/compare/6.3.0...7.0.0)

**API-breaking change:**

- ResultIterator getChoicesAndConfidence\(\) is now getSymbolChoicesAndConfidence\(\)

**Fixed bugs:**

- ResultIterator crashes with certain character combinations [\#126](https://github.com/rmtheis/tess-two/issues/126)
- ResultIterator returns single Character as Alternatives for Words [\#119](https://github.com/rmtheis/tess-two/issues/119)
- beginDocument\(\) returns false even when successful [\#103](https://github.com/rmtheis/tess-two/issues/103)

**Closed issues:**

- Hardcoded path in TessBaseAPITest.java [\#208](https://github.com/rmtheis/tess-two/issues/208)

**Merged pull requests:**

- Add missing PageSegMode constant [\#209](https://github.com/rmtheis/tess-two/pull/209) ([Robyer](https://github.com/Robyer))
- Fix return value of BeginDocument \(fixes \#103\) [\#207](https://github.com/rmtheis/tess-two/pull/207) ([Robyer](https://github.com/Robyer))
- Improve ResultIterator [\#206](https://github.com/rmtheis/tess-two/pull/206) ([Robyer](https://github.com/Robyer))
- Update gradle plugin [\#205](https://github.com/rmtheis/tess-two/pull/205) ([Robyer](https://github.com/Robyer))
- Fix javadocs errors and warnings [\#202](https://github.com/rmtheis/tess-two/pull/202) ([Robyer](https://github.com/Robyer))

## [6.3.0](https://github.com/rmtheis/tess-two/tree/6.2.0) (2017-04-06)
[Full Changelog](https://github.com/rmtheis/tess-two/compare/6.2.0...6.3.0)
Expand Down
9 changes: 9 additions & 0 deletions ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,12 @@ Phone/device architecture (armeabi, armeabi-v7a, x86, mips, arm64-v8a, x86_64, m



Link to training data used:



Link to image used as input:




9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ To use tess-two from your app, edit your app module's `build.gradle` file to add
tess-two as an external dependency:

dependencies {
compile 'com.rmtheis:tess-two:6.3.0'
implementation 'com.rmtheis:tess-two:9.0.0'
}

[Javadoc][javadoc] is available.
Expand Down Expand Up @@ -84,6 +84,12 @@ submitting a pull request through GitHub.
See the License for the specific language governing permissions and
limitations under the License.

## See Also

The Google Mobile Vision API team has made available an OCR capability that is
provided to developers through the Google Play Services library: The
[Mobile Vision API][mobile-vision-api] offers a simple API for OCR that
currently works for Latin-based characters.

[tesseract-android-tools]: https://github.com/alanv/tesseract-android-tools
[tesseract-ocr]: https://github.com/tesseract-ocr/tesseract
Expand All @@ -93,3 +99,4 @@ submitting a pull request through GitHub.
[javadoc]: https://rmtheis.github.io/tess-two/javadoc/index.html
[semantic-versioning]: http://semver.org
[stackoverflow]: https://stackoverflow.com/
[mobile-vision-api]: https://developers.google.com/vision/
6 changes: 4 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
classpath 'com.android.tools.build:gradle:3.1.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
}
Expand All @@ -14,9 +15,10 @@ buildscript {
allprojects {

group = 'com.rmtheis'
version = '6.3.0'
version = '9.0.0'

repositories {
google()
jcenter()
}
}
12 changes: 6 additions & 6 deletions eyes-two/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())

android {
compileSdkVersion 23
buildToolsVersion '25.0.0'
compileSdkVersion 27
buildToolsVersion '27.0.3'

defaultConfig {
minSdkVersion 9
targetSdkVersion 9
targetSdkVersion 22
versionCode 1
versionName "1.0"
versionName '1.0'
}

sourceSets {
Expand Down Expand Up @@ -59,6 +59,6 @@ android {
}

dependencies {
compile project(':tess-two');
compile fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':tess-two')
implementation fileTree(dir: 'libs', include: ['*.jar'])
}
2 changes: 1 addition & 1 deletion eyes-two/src/main/jni/Application.mk
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
APP_ABI := armeabi armeabi-v7a x86 mips arm64-v8a x86_64 mips64
APP_ABI := armeabi-v7a x86 arm64-v8a x86_64
APP_OPTIM := release
NDK_TOOLCHAIN_VERSION := clang
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sun Apr 02 14:22:01 PDT 2017
#Thu Apr 19 17:52:32 PDT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
31 changes: 16 additions & 15 deletions preparetests.cmd
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
git clone https://github.com/tesseract-ocr/tessdata.git
for /f %%i in ('adb shell echo $EXTERNAL_STORAGE') do set DIR=%%i

adb shell rm /sdcard/testAddPageToDocument.pdf
adb shell rm /sdcard/testCreate.pdf
git clone -b 3.04.00 https://github.com/tesseract-ocr/tessdata.git

adb shell rm %DIR%/testAddPageToDocument.pdf
adb shell rm %DIR%/testCreate.pdf

adb uninstall com.googlecode.tesseract.android.test

adb shell mkdir /sdcard/tesseract
adb shell mkdir /sdcard/tesseract/tessdata
adb shell mkdir %DIR%/tessdata

adb push -p tessdata/eng.cube.bigrams /sdcard/tesseract/tessdata
adb push -p tessdata/eng.cube.fold /sdcard/tesseract/tessdata
adb push -p tessdata/eng.cube.lm /sdcard/tesseract/tessdata
adb push -p tessdata/eng.cube.nn /sdcard/tesseract/tessdata
adb push -p tessdata/eng.cube.params /sdcard/tesseract/tessdata
adb push -p tessdata/eng.cube.size /sdcard/tesseract/tessdata
adb push -p tessdata/eng.cube.word-freq /sdcard/tesseract/tessdata
adb push -p tessdata/eng.tesseract_cube.nn /sdcard/tesseract/tessdata
adb push -p tessdata/eng.traineddata /sdcard/tesseract/tessdata
adb push -p tess-two/jni/com_googlecode_tesseract_android/src/tessdata/pdf.ttf /sdcard/tesseract/tessdata
adb push -p tessdata/eng.cube.bigrams %DIR%/tessdata
adb push -p tessdata/eng.cube.fold %DIR%/tessdata
adb push -p tessdata/eng.cube.lm %DIR%/tessdata
adb push -p tessdata/eng.cube.nn %DIR%/tessdata
adb push -p tessdata/eng.cube.params %DIR%/tessdata
adb push -p tessdata/eng.cube.size %DIR%/tessdata
adb push -p tessdata/eng.cube.word-freq %DIR%/tessdata
adb push -p tessdata/eng.tesseract_cube.nn %DIR%/tessdata
adb push -p tessdata/eng.traineddata %DIR%/tessdata
adb push -p tess-two/jni/com_googlecode_tesseract_android/src/tessdata/pdf.ttf %DIR%/tessdata
17 changes: 9 additions & 8 deletions preparetests.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
#!/bin/sh

git clone https://github.com/tesseract-ocr/tessdata.git
DIR="`adb shell echo \\$EXTERNAL_STORAGE`"

adb shell rm /sdcard/testAddPageToDocument.pdf
adb shell rm /sdcard/testCreate.pdf
git clone -b 3.04.00 https://github.com/tesseract-ocr/tessdata.git

adb shell rm $DIR/testAddPageToDocument.pdf
adb shell rm $DIR/testCreate.pdf

adb uninstall com.googlecode.tesseract.android.test

adb shell mkdir /sdcard/tesseract
adb shell mkdir /sdcard/tesseract/tessdata
adb shell mkdir $DIR/tessdata

for f in tessdata/eng.*; do
TRAINEDDATA_FILENAME="/sdcard/tesseract/tessdata/`basename $f`"
TRAINEDDATA_FILENAME="$DIR/tessdata/`basename $f`"

if [ `adb shell "if [ -f $TRAINEDDATA_FILENAME ]; then echo 1; fi"` ]; then
echo "$TRAINEDDATA_FILENAME already present on device"
continue
fi

echo "Copying $f to device...";
adb push -p $f /sdcard/tesseract/tessdata
adb push -p $f $DIR/tessdata
done

adb push -p tess-two/jni/com_googlecode_tesseract_android/src/tessdata/pdf.ttf /sdcard/tesseract/tessdata
adb push -p tess-two/jni/com_googlecode_tesseract_android/src/tessdata/pdf.ttf $DIR/tessdata

# adb shell am instrument -w com.googlecode.tesseract.android.test/android.test.InstrumentationTestRunner
13 changes: 6 additions & 7 deletions tess-two-test/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion '25.0.0'
compileSdkVersion 27
buildToolsVersion '27.0.3'

defaultConfig {
minSdkVersion 9
targetSdkVersion 22
versionCode 1
versionName "1.0"
versionName '1.0'
}

sourceSets {
Expand All @@ -28,7 +28,6 @@ android {
}

dependencies {
compile project(':tess-two');
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
}
implementation project(':tess-two')
testImplementation 'junit:junit:4.12'
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package com.googlecode.tesseract.android.test;

import android.annotation.SuppressLint;
import android.graphics.Bitmap;
import android.graphics.Bitmap.CompressFormat;
import android.graphics.Canvas;
Expand All @@ -26,6 +25,7 @@
import android.graphics.Paint.Style;
import android.graphics.Rect;
import android.os.AsyncTask;
import android.os.Environment;
import android.test.suitebuilder.annotation.SmallTest;
import android.text.Html;
import android.util.Pair;
Expand All @@ -47,10 +47,9 @@
import java.util.concurrent.Semaphore;

public class TessBaseAPITest extends TestCase {
@SuppressLint("SdCardPath")
static final String TESSBASE_PATH = "/sdcard/tesseract/";
static final String TESSBASE_PATH = Environment.getExternalStorageDirectory().toString();
static final String DEFAULT_LANGUAGE = "eng";
private static final String TESSDATA_PATH = TESSBASE_PATH + "tessdata/";
private static final String TESSDATA_PATH = TESSBASE_PATH + "/tessdata/";
private static final String[] EXPECTED_CUBE_DATA_FILES_ENG = {
"eng.cube.bigrams",
"eng.cube.fold",
Expand Down Expand Up @@ -112,7 +111,7 @@ public void testChoiceIterator() {
List<Pair<String, Double>> choicesAndConfidences;
iterator.begin();
do {
choicesAndConfidences = iterator.getChoicesAndConfidence(PageIteratorLevel.RIL_SYMBOL);
choicesAndConfidences = iterator.getSymbolChoicesAndConfidence();
assertNotNull("Invalid result.", choicesAndConfidences);

for (Pair<String, Double> choiceAndConfidence : choicesAndConfidences) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void testAddPageToDocument() throws IOException {

// Start the PDF writing process.
boolean beginSuccess = baseApi.beginDocument(pdfRenderer, "title");
// assertTrue(beginSuccess);
assertTrue(beginSuccess);

// Add a page to the PDF.
final Pix pixOne = getTextImage("page one", 640, 480);
Expand Down
Loading

0 comments on commit e9c7aaa

Please sign in to comment.