Skip to content

🐞 Repair discretionary hyphens in copied PDF text - #236

Merged
JFWooten4 merged 1 commit into
mainfrom
silver-spanner
Nov 28, 2026
Merged

JFWooten4 merged 1 commit into
mainfrom
silver-spanner

Conversation

@JFWooten4

Copy link
Copy Markdown
Member

PDF text extraction can retain typesetting hyphens even after the original line breaks have been flattened. For example, clearing cor-porations and securi-ties depositories should copy as clearing corporations and securities depositories.

This change adds conservative, offline English dictionary-assisted dehyphenation to the shared clipboard reflow pipeline. It also recognizes geometric line wraps, including PDF text items without an explicit end-of-line marker. Genuine compounds such as self-regulatory, book-entry, and co-operate, URL tokens, and numeric identifiers such as 17Ad-10 are retained. Unknown and ambiguous spellings are left intact rather than silently rewritten. The original layout remains available when paragraph reflow is disabled.

  • Apply repairs to Markdown, plain-text, and automatic selection copying through the shared serializer.
  • Add regressions for flattened OCR, wrapped lines, compound preservation, emphasis, paragraph/page boundaries, and plain-text fallback.
  • Pin the MIT-licensed English word list and include its license in the packaged extension. No network lookup is needed during copying.

The committed tree and changed files were verified. The full dependency-backed test suite has not been run locally because this environment cannot access the npm registry; CI must validate the package and regressions.

Write PR descriptions automatically.

Use a local English lexicon to repair flattened OCR and wrapped word fragments when paragraph reflow is enabled. Preserve recognized compounds, identifiers, URL tokens, and page or paragraph boundaries; cover Markdown and plain clipboard paths with regressions. Include the lexicon license in the extension build.

Co-authored-by: ChatGPT 6.2 <[email protected]>
@JFWooten4
JFWooten4 merged commit 245961a into main Nov 28, 2026
14 checks passed
@JFWooten4
JFWooten4 deleted the silver-spanner branch November 28, 2026 16:46
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