Skip to content

fix(ocr): retain Google Vision paragraph tails and break hints - #4824

Draft
Afloat16 wants to merge 1 commit into
Unstructured-IO:mainfrom
Afloat16:Afloat16/google-vision-paragraph-breaks-20261121
Draft

Afloat16 wants to merge 1 commit into
Unstructured-IO:mainfrom
Afloat16:Afloat16/google-vision-paragraph-breaks-20261121

Conversation

@Afloat16

@Afloat16 Afloat16 commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Google Vision paragraph reconstruction only flushes accumulated text when it sees a line-ending break. A paragraph without that final marker returns an empty string or loses its last line. Several valid break types are also ignored.

Append every symbol directly and apply its prefix/suffix break hint. Preserve regular and sure spaces, line wraps, paragraph breaks and end-line hyphens, then trim trailing separators. This follows the provider's DetectedBreak definition.

Validation

  • Real Google Vision protobuf fixtures cover missing final breaks, SPACE/SURE_SPACE/EOL_SURE_SPACE, LINE_BREAK, HYPHEN, prefix breaks and empty/already-terminated controls.
  • Base revision: 7 failures, 2 passes. Final: 9 passed.
  • No service requests or credentials are used in tests.
  • Repository Ruff 0.15.10 lint and format checks pass.

Draft pending the full repository test gate.

Checklist

  • Conventional user-facing title.
  • Maintainer: apply the appropriate category label.
  • Full repository test gate.

This branch has not been deployed

No deployments
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