-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from BlinkID/release/v3.10.0
Release/v3.10.0
- Loading branch information
Showing
87 changed files
with
5,750 additions
and
572 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
126 changes: 126 additions & 0 deletions
126
.../com/microblink/libresult/extract/austria/AustrianPassportRecognitionResultExtractor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
package com.microblink.libresult.extract.austria; | ||
|
||
import android.content.Context; | ||
|
||
import com.microblink.libresult.R; | ||
import com.microblink.libresult.extract.RecognitionResultEntry; | ||
import com.microblink.libresult.extract.mrtd.MRTDRecognitionResultExtractor; | ||
import com.microblink.recognizers.BaseRecognitionResult; | ||
import com.microblink.recognizers.blinkid.austria.passport.AustrianPassportRecognitionResult; | ||
import com.microblink.results.date.Date; | ||
|
||
import java.util.List; | ||
|
||
|
||
/** | ||
* Result extractor for Austrian passport | ||
*/ | ||
public class AustrianPassportRecognitionResultExtractor extends MRTDRecognitionResultExtractor{ | ||
|
||
public AustrianPassportRecognitionResultExtractor(Context context) { | ||
super(context); | ||
} | ||
|
||
@Override | ||
public List<RecognitionResultEntry> extractData(BaseRecognitionResult result) { | ||
if (result == null) { | ||
return mExtractedData; | ||
} | ||
|
||
if (result instanceof AustrianPassportRecognitionResult) { | ||
AustrianPassportRecognitionResult autPassResult = (AustrianPassportRecognitionResult) result; | ||
|
||
String name = autPassResult.getName(); | ||
if (name != null && !name.isEmpty()) { | ||
mExtractedData.add(mBuilder.build( | ||
R.string.PPFirstName, | ||
name | ||
)); | ||
} | ||
|
||
String surname = autPassResult.getSurname(); | ||
if (surname != null && !surname.isEmpty()) { | ||
mExtractedData.add(mBuilder.build( | ||
R.string.PPLastName, | ||
surname | ||
)); | ||
} | ||
|
||
String placeOfBirth = autPassResult.getPlaceOfBirth(); | ||
if (placeOfBirth != null) { | ||
mExtractedData.add(mBuilder.build( | ||
R.string.PPPlaceOfBirth, | ||
placeOfBirth | ||
)); | ||
} | ||
|
||
String sex = autPassResult.getNonMRZSex(); | ||
if (sex != null) { | ||
mExtractedData.add(mBuilder.build( | ||
R.string.PPSex, | ||
sex | ||
)); | ||
} | ||
|
||
String nat = autPassResult.getNonMRZNationality(); | ||
if (nat != null && !nat.isEmpty()) { | ||
mExtractedData.add(mBuilder.build( | ||
R.string.PPNationality, | ||
nat | ||
)); | ||
} | ||
|
||
String authority = autPassResult.getAuthority(); | ||
if (authority != null && !authority.isEmpty()) { | ||
mExtractedData.add(mBuilder.build( | ||
R.string.PPAuthority, | ||
authority | ||
)); | ||
} | ||
|
||
Date dateOfBirth = autPassResult.getNonMRZDateOfBirth(); | ||
if (dateOfBirth != null) { | ||
mExtractedData.add(mBuilder.build( | ||
R.string.PPDateOfBirth, | ||
dateOfBirth | ||
)); | ||
} | ||
|
||
Date dateOfIssue = autPassResult.getDateOfIssue(); | ||
if (dateOfIssue != null) { | ||
mExtractedData.add(mBuilder.build( | ||
R.string.PPIssueDate, | ||
dateOfIssue | ||
)); | ||
} | ||
|
||
Date dateOfExpiry = autPassResult.getNonMRZDateOfExpiry(); | ||
if (dateOfExpiry != null) { | ||
mExtractedData.add(mBuilder.build( | ||
R.string.PPDateOfExpiry, | ||
dateOfExpiry | ||
)); | ||
} | ||
|
||
String height = autPassResult.getHeight(); | ||
if (height != null) { | ||
mExtractedData.add(mBuilder.build( | ||
R.string.PPHeight, | ||
height | ||
)); | ||
} | ||
|
||
String passportNumber = autPassResult.getPassportNumber(); | ||
if (passportNumber != null) { | ||
mExtractedData.add(mBuilder.build( | ||
R.string.PPPassportNumber, | ||
passportNumber | ||
)); | ||
} | ||
|
||
super.extractMRZData(autPassResult); | ||
} | ||
|
||
return mExtractedData; | ||
} | ||
} |
Oops, something went wrong.