Repository navigation
Document how to clean text from PDF parsers before splitting - #42
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FHW7nLqPiFJhQm6M1ARLi6
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018jNL9rsodv5SMpDXVNMEia
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Adds a "Cleaning text from PDF parsers" subsection to the README, under Usage between "Breadcrumbs" and "Limitations". It:
split_textkeeps the spans indexing into the cleaned string.unicodedata.normalize("NFKC", pdf_markdown), then removes the soft hyphen () and zero-width space () withstr.replace, then callsMarkdownSplitter().split_text(clean). The two characters are written as escapes so they are visible and survive copy-paste.Müller), superscripts are folded (x²becomesx2), and soft hyphens and zero-width spaces needstr.replace.No code changes, no new parameters or dependencies. No CHANGELOG entry: this is a docs-only change.
Verification
main(after Make MarkdownSplitter an immutable class and remove the outline #41, Clean up the splitter internals #43, Return only the header line from to_markdown for empty sections #44 and Test code, not the libraries, and run the doctest #45) into the branch. The diff againstmainis the README section only.unicodedata.normalize("NFKC", ...).main's API. The sample text hasfi,fl, a non-breaking space, a soft hyphen, a zero-width space, fullwidth letters and digits, andx². The cleaned text has none of the first five, andclean[start:end]for each section span starts with the header line and ends with the section's content.uv run pytest -q(90 passed, including the doctest) anduv run ruff check --no-fix .pass.