java.lang.Object
com.microblink.photopay.entities.Entity<T>
com.microblink.photopay.entities.parsers.Parser<SerbiaReferenceParser.Result>
com.microblink.photopay.entities.parsers.photopay.serbia.reference.SerbiaReferenceParser
All Implemented Interfaces:
android.os.Parcelable

public final class SerbiaReferenceParser extends Parser<SerbiaReferenceParser.Result>
Parser that can extract Serbian payment reference number from the OCR result.
  • Field Details

  • Constructor Details

    • SerbiaReferenceParser

      public SerbiaReferenceParser()
  • Method Details

    • setAllowAlphaCharacters

      public void setAllowAlphaCharacters(boolean allowAlphaCharacters)
      Indicates whether parsing of references that contain uppercase letters will be allowed. If set to false, only references containing digits and dashes will be parsed. If you need to read references that also contain letters, set this to true. Please note that enabling letters in references reduces the recognition quality. By default, this is set to 'true'
    • shouldAllowAlphaCharacters

      public boolean shouldAllowAlphaCharacters()
      Indicates whether parsing of references that contain uppercase letters will be allowed. If set to false, only references containing digits and dashes will be parsed. If you need to read references that also contain letters, set this to true. Please note that enabling letters in references reduces the recognition quality. By default, this is set to 'true'
    • setPreferMod97Reference

      public void setPreferMod97Reference(boolean preferMod97Reference)
      Indicates whether mod97 references will be preferred in parsing. Setting this to true (default) will yield better quality results when parsing references that have check digit according to mod97 check digit algorithm, but may cause wrongly parsed reference in case mod97 is not expected. Example for this case is reference which does not have mod97 check digit and has misrecognized digit 5 as digit 3 and whole reference with misrecognized digit is correct according to mod97 checkdigit algorithm - in that case misrecognized reference number will be preferred just because it can be checked with mod97 algorithm. Set this to false to retrieve exactly same results as OCR engine has returned them - note that in that case misrecognition probability is higher because there will be no checkdigit verification. By default, this is set to 'true'
    • shouldPreferMod97Reference

      public boolean shouldPreferMod97Reference()
      Indicates whether mod97 references will be preferred in parsing. Setting this to true (default) will yield better quality results when parsing references that have check digit according to mod97 check digit algorithm, but may cause wrongly parsed reference in case mod97 is not expected. Example for this case is reference which does not have mod97 check digit and has misrecognized digit 5 as digit 3 and whole reference with misrecognized digit is correct according to mod97 checkdigit algorithm - in that case misrecognized reference number will be preferred just because it can be checked with mod97 algorithm. Set this to false to retrieve exactly same results as OCR engine has returned them - note that in that case misrecognition probability is higher because there will be no checkdigit verification. By default, this is set to 'true'
    • terminateNative

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

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

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

      public SerbiaReferenceParser 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<SerbiaReferenceParser.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<SerbiaReferenceParser.Result>
      Parameters:
      other - Entity from which result should be consumed.
    • consumeResult

      public void consumeResult(@NonNull SerbiaReferenceParser.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<SerbiaReferenceParser.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<SerbiaReferenceParser.Result>