-
public class ResultIterator extends PageIterator
Java interface for the ResultIterator. Does not implement all available JNI methods, but does implement enough to be useful. Comments are adapted from original Tesseract source.
-
-
Method Summary
Modifier and Type Method Description StringgetUTF8Text(int level)Returns the text string for the current object at the given level. floatconfidence(int level)Returns the mean confidence of the current object at the given level. booleanisAtBeginningOf(int level)Returns true if the iterator is at the start of an object at the givenlevel. booleanisAtFinalElement(int level, int element)Returns whether the iterator is positioned at the last element in agiven level. List<Pair<String, Double>>getSymbolChoicesAndConfidence()Returns all possible matching text strings and their confidence levelfor the current object. voiddelete()Deletes the iterator after use -
-
Method Detail
-
getUTF8Text
String getUTF8Text(int level)
Returns the text string for the current object at the given level.
- Parameters:
level- the page iterator level.
-
confidence
float confidence(int level)
Returns the mean confidence of the current object at the given level. Thenumber should be interpreted as a percent probability (0-100).
- Parameters:
level- the page iterator level.
-
isAtBeginningOf
boolean isAtBeginningOf(int level)
Returns true if the iterator is at the start of an object at the givenlevel. Possible uses include determining if a call to Next(RIL_WORD)moved to the start of a RIL_PARA.
- Parameters:
level- the page iterator level.
-
isAtFinalElement
boolean isAtFinalElement(int level, int element)
Returns whether the iterator is positioned at the last element in agiven level. (e.g. the last word in a line, the last line in a block)
- Parameters:
level- the page iterator level.element- the page iterator level.
-
getSymbolChoicesAndConfidence
List<Pair<String, Double>> getSymbolChoicesAndConfidence()
Returns all possible matching text strings and their confidence levelfor the current object.
The default matching text is blank ("").The default confidence level is zero (0.0)
-
delete
void delete()
Deletes the iterator after use
-
-
-
-