00001 /* 00002 * Copyright (C) 2012 Google Inc. 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); you may not 00005 * use this file except in compliance with the License. You may obtain a copy of 00006 * the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 00012 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 00013 * License for the specific language governing permissions and limitations under 00014 * the License. 00015 */ 00016 00026 package com.googlecode.tesseract.android; 00027 00028 import com.googlecode.tesseract.android.TessBaseAPI.PageIteratorLevel; 00029 00036 public class ResultIterator extends PageIterator { 00037 static { 00038 System.loadLibrary("lept"); 00039 System.loadLibrary("tess"); 00040 } 00041 00043 private final int mNativeResultIterator; 00044 00045 /* package */ResultIterator(int nativeResultIterator) { 00046 super(nativeResultIterator); 00047 00048 mNativeResultIterator = nativeResultIterator; 00049 } 00050 00058 public String getUTF8Text(int level) { 00059 return nativeGetUTF8Text(mNativeResultIterator, level); 00060 } 00061 00071 public float confidence(int level) { 00072 return nativeConfidence(mNativeResultIterator, level); 00073 } 00074 00075 private static native String nativeGetUTF8Text(int nativeResultIterator, 00076 int level); 00077 00078 private static native float nativeConfidence(int nativeResultIterator, 00079 int level); 00080 }