Class RawParser
java.lang.Object
com.microblink.photopay.entities.Entity<T>
com.microblink.photopay.entities.parsers.Parser<RawParser.Result>
com.microblink.photopay.entities.parsers.raw.RawParser
- All Implemented Interfaces:
android.os.Parcelable
A parser that simply returns the string version of raw OCR result, without performing
any smart parsing operations.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from class com.microblink.photopay.entities.parsers.Parser
CLASS_NAMEFields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClears parser result.clone()Create a copy of the entity.voidconsumeResult(RawParser.Result resultToConsume) Consumes given result.voidconsumeResultFrom(Entity other) Consume result from other entity.protected voiddeserializeNativeSettings(byte[] serializedSettings) Returns the OCR engine options used in Regex OCR parser.protected byte[]voidsetOcrEngineOptions(AbstractOCREngineOptions ocrEngineOptions) Sets the OCR engine options used in Regex OCR parser.voidsetUseSieve(boolean useSieve) Enable the usage of algorithm for combining consecutive OCR results between video frames for improving OCR quality.booleanReturns true if algorithm for combining consecutive OCR results between video frames for improving OCR quality is used.protected voidterminateNative(long nativeContext) Methods inherited from class com.microblink.photopay.entities.parsers.Parser
getPriority, isRequired, setRequiredMethods inherited from class com.microblink.photopay.entities.Entity
describeContents, finalize, getNativeContext, getResult, nativeGetNativeResultContext, readFromParcel, writeToParcel
-
Field Details
-
CREATOR
-
-
Constructor Details
-
RawParser
public RawParser()
-
-
Method Details
-
setOcrEngineOptions
Sets the OCR engine options used in Regex OCR parser. By default, this is set to 'default instance ofBlinkOCREngineOptions'.- Parameters:
ocrEngineOptions- OCR engine options used in Regex OCR parser
-
getOcrEngineOptions
Returns the OCR engine options used in Regex OCR parser. By default, this is set to 'default instance ofBlinkOCREngineOptions'.- 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 ofBlinkOCREngineOptionsis given tosetOcrEngineOptions(com.microblink.photopay.entities.ocrengine.AbstractOCREngineOptions). Otherwise, it will not be enabled andIllegalArgumentExceptionwill 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:
terminateNativein classEntity<RawParser.Result>
-
serializeNativeSettings
@Nullable protected byte[] serializeNativeSettings()- Specified by:
serializeNativeSettingsin classEntity<RawParser.Result>
-
deserializeNativeSettings
protected void deserializeNativeSettings(@NonNull byte[] serializedSettings) - Specified by:
deserializeNativeSettingsin classEntity<RawParser.Result>
-
clone
Description copied from class:EntityCreate 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 theRecognizerRunnerVieworRecognizerRunnerwith the updated entity hierarchy.- Specified by:
clonein classEntity<RawParser.Result>- Returns:
- a copy of the entity
-
consumeResultFrom
Description copied from class:EntityConsume result from other entity. The result from other will be put instead current result of this entity. This method is used insideBaseIntentTransferable.loadFromIntent(Intent)and similar methods to replace the result content of the saved entities with results that have arrived overIntent- Specified by:
consumeResultFromin classEntity<RawParser.Result>- Parameters:
other- Entity from which result should be consumed.
-
consumeResult
Description copied from class:ParserConsumes given result. The given result will be put instead current result of this entity.- Specified by:
consumeResultin classParser<RawParser.Result>- Parameters:
resultToConsume- Result that should be consumed.
-
clearResult
public void clearResult()Description copied from class:ParserClears parser result.- Specified by:
clearResultin classParser<RawParser.Result>
-