feat: build MRZ parser from source (submodule) + return exact scanned mrz#161
Draft
haklyray wants to merge 1 commit into
Draft
feat: build MRZ parser from source (submodule) + return exact scanned mrz#161haklyray wants to merge 1 commit into
haklyray wants to merge 1 commit into
Conversation
Replace the prebuilt smartscanner-mrz-parser.aar with a git submodule of the parser source (idpass/smartscanner-mrz-parser), wired in via settings.gradle.kts. MRZResult now returns the exact scanned MRZ captured by the parser (record.rawMrz), falling back to the lossy toMrz() reconstruction only when unavailable, so overflow document numbers (e.g. the 11-digit Dominican cédula) are no longer truncated. Add MRZResultTest and enable unitTests.isReturnDefaultValues so the parser's android.util.Log calls are stubbed in JVM unit tests.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the returned
mrzand brings the MRZ parser into the repo as source.What
smartscanner-mrz-parser.aarwith a git submodule ofidpass/smartscanner-mrz-parser, wired viasettings.gradle.kts(projectDir → smartscanner-mrz-parser/parser).core-lib's dependency line is unchanged.mrz—MRZResult.mrznow returnsrecord.rawMrz(the exact cleaned scan captured by the parser), falling back totoMrz()only when unavailable.toMrz()was a lossy rebuild (fixed 9-char document-number field) that truncated overflow numbers like the 11-digit Dominican cédula.unitTests.isReturnDefaultValuesso the parser'sandroid.util.Logcalls are stubbed in JVM unit tests.Depends on the parser PR: idpass/smartscanner-mrz-parser#11 (the submodule is pinned to that branch commit; bump to the merged
mastercommit once it lands).Tests
MRZResultTest—mrzequals the exact scan (nottoMrz()), and the 11-digit DOM document number is preserved. Verified::smartscanner-mrz-parser:testDebugUnitTest,:core-lib:testDebugUnitTest,:core-lib:assembleDebugall green.Sequencing
Stacked on the OCR branch (PR #160) because it relies on that branch's KTS build migration. After #160 merges to
develop, retarget this PR's base todevelop(the diff stays MRZ-only).