feat(parser): fix OCR character misreads in money spans #96

Closed
opened 2026-07-07 09:26:28 +01:00 by TimCane · 0 comments
TimCane commented 2026-07-07 09:26:28 +01:00 (Migrated from github.com)

Parent: #77 (Phase B, capability). Invariants live in the epic.

Repair common OCR character misreads inside numeric spans.

Anchors

  • Normalizer from #90 (Parsing/Normalization) - where the fix belongs.
  • MoneyAtEnd (ReceiptParser.cs:25) and ToMinor (215) - the money spans to
    protect.
  • Risk cases to NOT mangle: item names with digits/letters (7UP,
    No.8 Burger).

Steps

  1. Add a misread pass that maps O<->0, S->5, l/I->1, B->8, £<->E only
    inside money/number contexts (e.g. E12.5O -> £12.50).
  2. Gate it to digit-adjacent positions so alphabetic names are untouched.

Done

  • One new fixture per misread class, each a real recorded misread.
  • Existing corpus green (no name mangling).
Parent: #77 (Phase B, capability). Invariants live in the epic. Repair common OCR character misreads inside numeric spans. ## Anchors - Normalizer from #90 (`Parsing/Normalization`) - where the fix belongs. - `MoneyAtEnd` (`ReceiptParser.cs:25`) and `ToMinor` (215) - the money spans to protect. - Risk cases to NOT mangle: item names with digits/letters (`7UP`, `No.8 Burger`). ## Steps 1. Add a misread pass that maps `O<->0`, `S->5`, `l/I->1`, `B->8`, `£<->E` only inside money/number contexts (e.g. `E12.5O` -> `£12.50`). 2. Gate it to digit-adjacent positions so alphabetic names are untouched. ## Done - [ ] One new fixture per misread class, each a real recorded misread. - [ ] Existing corpus green (no name mangling).
Sign in to join this conversation.
No description provided.