feat(parser): merge item names wrapped across lines #111

Merged
TimCane merged 4 commits from feat/98-wrapped-names into main 2026-07-07 13:45:54 +01:00
TimCane commented 2026-07-07 12:56:29 +01:00 (Migrated from github.com)

Summary

  • Add WrappedNameMerger (Parsing/Multiline): a gated pre-pass that folds an item name split across OCR lines onto its price row (Classic / BAO / £6.50 -> Classic BAO £6.50).
  • Fires only for a nameless priced line on a receipt with a structural total, borrowing a bounded run of letter-only fragments immediately above - so already-inline receipts, non-receipts, and fully column-drifted layouts (the box-sort pass's job) are untouched.
  • New fixture wrapped-item-names; the 33-receipt corpus stays byte-for-byte green (no existing expected.json changed).
  • Docs: flip the wrapped-name entries to current in docs/15; note the pre-pass in docs/06; record the fixture in docs/11.

Test plan

  • dotnet test backend/tests/BillSplitter.Tests -> 92 passed, 0 failed.
  • Stashing the engine wiring fails only the new wrapped-item-names fixture, confirming the merge is load-bearing and does not perturb existing receipts.

Closes #98

## Summary - Add `WrappedNameMerger` (`Parsing/Multiline`): a gated pre-pass that folds an item name split across OCR lines onto its price row (`Classic` / `BAO` / `£6.50` -> `Classic BAO £6.50`). - Fires only for a nameless priced line on a receipt with a structural total, borrowing a bounded run of letter-only fragments immediately above - so already-inline receipts, non-receipts, and fully column-drifted layouts (the box-sort pass's job) are untouched. - New fixture `wrapped-item-names`; the 33-receipt corpus stays byte-for-byte green (no existing `expected.json` changed). - Docs: flip the wrapped-name entries to *current* in docs/15; note the pre-pass in docs/06; record the fixture in docs/11. ## Test plan - `dotnet test backend/tests/BillSplitter.Tests` -> 92 passed, 0 failed. - Stashing the engine wiring fails only the new `wrapped-item-names` fixture, confirming the merge is load-bearing and does not perturb existing receipts. Closes #98
Sign in to join this conversation.
No description provided.