Skip to content

feat: build MRZ parser from source (submodule) + return exact scanned mrz#161

Draft
haklyray wants to merge 1 commit into
feat/Improvement-of-OCRfrom
feat/mrz-parser-source
Draft

feat: build MRZ parser from source (submodule) + return exact scanned mrz#161
haklyray wants to merge 1 commit into
feat/Improvement-of-OCRfrom
feat/mrz-parser-source

Conversation

@haklyray

Copy link
Copy Markdown
Collaborator

Fixes the returned mrz and brings the MRZ parser into the repo as source.

What

  • Parser from source — replace the prebuilt smartscanner-mrz-parser.aar with a git submodule of idpass/smartscanner-mrz-parser, wired via settings.gradle.kts (projectDir → smartscanner-mrz-parser/parser). core-lib's dependency line is unchanged.
  • Exact scanned mrzMRZResult.mrz now returns record.rawMrz (the exact cleaned scan captured by the parser), falling back to toMrz() 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.
  • Enable unitTests.isReturnDefaultValues so the parser's android.util.Log calls 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 master commit once it lands).

Tests

MRZResultTestmrz equals the exact scan (not toMrz()), and the 11-digit DOM document number is preserved. Verified: :smartscanner-mrz-parser:testDebugUnitTest, :core-lib:testDebugUnitTest, :core-lib:assembleDebug all 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 to develop (the diff stays MRZ-only).

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant