Join OCR line breaks into flowing text #1

Merged
clayschaad merged 1 commit from feature/ocr-remove-newlines into main 2026-11-06 14:24:53 +00:00
Owner

Summary

Scanned text kept a newline wherever the photographed page wrapped, so notes created via the camera scan were broken into short lines.

The OCR cleanup in client/src/lib/ocr.ts now:

  • joins lines within a paragraph with a space
  • keeps blank lines as paragraph breaks
  • re-joins words hyphenated across a line break (Verwal- + tung → Verwaltung)
  • keeps the hyphen in compounds split at a line end when the next part is capitalised (Nord- + Süd → Nord-Süd)

Known limitation

A line-end hyphen followed by a lowercase word is always dropped, so a rare case like Ein- + und Ausgang becomes Einund Ausgang.

Testing

  • Ran a sample German text through the cleanup and got the expected output
  • npm run build -w client passes
  • Not yet tried with a real photo in the app

🤖 Generated with Claude Code

## Summary Scanned text kept a newline wherever the photographed page wrapped, so notes created via the camera scan were broken into short lines. The OCR cleanup in `client/src/lib/ocr.ts` now: - joins lines within a paragraph with a space - keeps blank lines as paragraph breaks - re-joins words hyphenated across a line break (`Verwal-` + `tung` → `Verwaltung`) - keeps the hyphen in compounds split at a line end when the next part is capitalised (`Nord-` + `Süd` → `Nord-Süd`) ## Known limitation A line-end hyphen followed by a lowercase word is always dropped, so a rare case like `Ein-` + `und Ausgang` becomes `Einund Ausgang`. ## Testing - Ran a sample German text through the cleanup and got the expected output - `npm run build -w client` passes - Not yet tried with a real photo in the app 🤖 Generated with [Claude Code](https://claude.com/claude-code)
clayschaad added 1 commit 2026-11-06 14:23:42 +00:00
Scanned text kept a newline wherever the photographed page wrapped.
Lines within a paragraph are now joined with spaces, blank lines are
kept as paragraph breaks, and words hyphenated across a line break are
re-joined.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
clayschaad merged commit 42f6b63715 into main 2026-11-06 14:24:53 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: clayschaad/Notes#1
No description provided.