Package 

Class ResultIterator


  • 
    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
      String getUTF8Text(int level) Returns the text string for the current object at the given level.
      float confidence(int level) Returns the mean confidence of the current object at the given level.
      boolean isAtBeginningOf(int level) Returns true if the iterator is at the start of an object at the givenlevel.
      boolean isAtFinalElement(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.
      void delete() Deletes the iterator after use
      • Methods inherited from class com.googlecode.tesseract.android.PageIterator

        begin, getBoundingBox, getBoundingRect, next
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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