All Implemented Interfaces:
android.os.Parcelable

public final class RawParser extends Parser<RawParser.Result>
A parser that simply returns the string version of raw OCR result, without performing any smart parsing operations.
  • Field Details

    • CREATOR

      public static final android.os.Parcelable.Creator<RawParser> CREATOR
  • Constructor Details

    • RawParser

      public RawParser()
  • Method Details

    • setOcrEngineOptions

      public void setOcrEngineOptions(@NonNull AbstractOCREngineOptions ocrEngineOptions)
      Sets the OCR engine options used in Regex OCR parser. By default, this is set to 'default instance of BlinkOCREngineOptions'.
      Parameters:
      ocrEngineOptions - OCR engine options used in Regex OCR parser
    • getOcrEngineOptions

      @NonNull public AbstractOCREngineOptions getOcrEngineOptions()
      Returns the OCR engine options used in Regex OCR parser. By default, this is set to 'default instance of BlinkOCREngineOptions'.
      Returns:
      OCR engine options used in Regex OCR parser
    • setUseSieve

      public void setUseSieve(boolean useSieve)
      Enable the usage of algorithm for combining consecutive OCR results between video frames for improving OCR quality. By default, this is set to 'false'. Note: This option works together only with if instance of BlinkOCREngineOptions is given to setOcrEngineOptions(com.microblink.photopay.entities.ocrengine.AbstractOCREngineOptions). Otherwise, it will not be enabled and IllegalArgumentException will be thrown.
      Parameters:
      useSieve - whether or not sieve algorithm should be used
    • shouldUseSieve

      public boolean shouldUseSieve()
      Returns true if algorithm for combining consecutive OCR results between video frames for improving OCR quality is used. By default, this is set to 'false'
      Returns:
      true if sieve algorithm is used
    • terminateNative

      protected void terminateNative(long nativeContext)
      Specified by:
      terminateNative in class Entity<RawParser.Result>
    • serializeNativeSettings

      @Nullable protected byte[] serializeNativeSettings()
      Specified by:
      serializeNativeSettings in class Entity<RawParser.Result>
    • deserializeNativeSettings

      protected void deserializeNativeSettings(@NonNull byte[] serializedSettings)
      Specified by:
      deserializeNativeSettings in class Entity<RawParser.Result>
    • clone

      public RawParser clone()
      Description copied from class: Entity
      Create a copy of the entity. This is required if properties of the entity must be modified while background thread performs processing. In order to avoid race conditions, changing properties is not allowed while entity is used in background processing. However, you are able to make a copy of the entity, change properties of it and then update the RecognizerRunnerView or RecognizerRunner with the updated entity hierarchy.
      Specified by:
      clone in class Entity<RawParser.Result>
      Returns:
      a copy of the entity
    • consumeResultFrom

      public void consumeResultFrom(@NonNull Entity other)
      Description copied from class: Entity
      Consume result from other entity. The result from other will be put instead current result of this entity. This method is used inside BaseIntentTransferable.loadFromIntent(Intent) and similar methods to replace the result content of the saved entities with results that have arrived over Intent
      Specified by:
      consumeResultFrom in class Entity<RawParser.Result>
      Parameters:
      other - Entity from which result should be consumed.
    • consumeResult

      public void consumeResult(@NonNull RawParser.Result resultToConsume)
      Description copied from class: Parser
      Consumes given result. The given result will be put instead current result of this entity.
      Specified by:
      consumeResult in class Parser<RawParser.Result>
      Parameters:
      resultToConsume - Result that should be consumed.
    • clearResult

      public void clearResult()
      Description copied from class: Parser
      Clears parser result.
      Specified by:
      clearResult in class Parser<RawParser.Result>