Skip to content

v5 F2: per-call OCR option overrides - #698

Merged
TheJoeFin merged 5 commits into
devfrom
v5/f2-ocr-options
Nov 10, 2026
Merged

TheJoeFin merged 5 commits into
devfrom
v5/f2-ocr-options

Conversation

@TheJoeFin

Copy link
Copy Markdown
Owner

Summary

  • Adds OcrOptions (Core) with FromSettings, an immutable per-call record of OCR text-shaping options.
  • Threads an optional trailing OcrOptions? options = null through OcrOutput.CleanOutput, OcrUtilities (GetTextFromOcrLine, BuildTextFromOcrLines, ShouldUseParagraphDetection, ParseOcrResultIntoWordBorderInfos, GetStringFromOcrOutputs) and TesseractHelper.GetOcrOutputFromBitmap. null keeps today's behavior; no existing call site changed.
  • Characterization tests (written against the old code) plus override tests.
  • Marks F2 done in docs/v5/README.md and corrects the F2 plan's current-state notes.

Notes

  • TryToReadBarcodes is only read in the app, so OcrOptions carries it but nothing in Core.Windows consumes it yet (F3).
  • Existing quirk preserved: on the space-joining path GetTextFromOcrLine discards the result of TryFixEveryWordLetterNumberErrors, so CorrectErrors has no effect there. Pinned in tests, not fixed.
  • No new NuGet packages.

Test plan

  • dotnet build Tests/Tests.csproj -c Debug -p:Platform=x64 (0 errors)
  • Tests.Core 997 / Tests.Core.Windows 240 (4 skipped) / Tests 893 (3 skipped): 0 failures

🤖 Generated with Claude Code

@TheJoeFin
TheJoeFin merged commit 0eb3a83 into dev Nov 10, 2026
1 check passed
@TheJoeFin
TheJoeFin deleted the v5/f2-ocr-options branch November 10, 2026 03:05
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