Repository navigation
v0.4.0: natural reading (sentence-aware chunking, number/currency reading) + Report a problem - #1
Merged
Merged
Conversation
Wrap the kokoro-js tokenizer to detect >500 phoneme tokens before inference, then split near the middle (; : , space) and join the audio with a 60ms gap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Treat Draft.js blocks as paragraph blocks, separate block boundaries in paragraph text, and split live blocks at <br><br> runs. Adds an extraction check script and HTML fixtures. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…wikipedia) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ts to chunker.test.ts Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d punctuation pauses Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s, money, units, dates, symbols Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… read as 'slash'; tests Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… cr = crore, yr = year Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…; bump version Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Opens a prefilled GitHub issue with Lector/browser/engine details. Never includes the page URL, title or text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…en a copy's leaf maps to a wrapper Reverts the <br><br> splitting (paragraphs lost their element, breaking Alt+click / listen-from-here) and the block-spacing change (broke relocate() after SPA re-renders). Extraction on paulgraham.com and Wikipedia is identical to main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hains, scores, meters Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…double tokenization in length guard Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e caught every segment failing Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Lector now reads in whole sentences and says numbers the way a person would.
Why
No LLM. Lector doesn't load one. Adding one would cost a 350–500 MB download, seconds to minutes before the first word, and a model that can rewrite words, which breaks the page highlighting. Rules are instant and testable.
What changed
shared/chunker.ts)1/thread numbering.; : —first, then commas, then clause words, then a space. It avoids short leftover fragments and never breaks inside a number, currency amount or unit.?/!,.,: ; —,,, or none).shared/normalize.ts), rules ported from misaki (Apache-2.0), plusnumber-to-words(MIT, about 1.3 KB). It covers:1/numberingengine.worker.ts): a segment over 500 phoneme tokens is split and its audio joined. kokoro-js used to silently cut off the end.content.ts): Draft.js blocks (X Articles) are treated as paragraphs. When Readability's copy of a block maps to a live wrapper, the live paragraphs are read instead. Output on paulgraham.com and Wikipedia is identical tomain.Verification
tscis clean andbun testpasses (205 tests). Your screenshot paragraphs are fixtures, and each review finding has a test.scripts/e2e.mjswith real Kokoro passes every check on WebGPU and NO_GPU at the final tip.That run caught a release blocker the unit tests couldn't: the guard called
.callon the tokenizer, which doesn't have one. Fixed in 8d5b337.The guard fired on a real page (726 tokens) and the full 41.8 s of audio was produced, so nothing was truncated.
Bench, warm runs, one run each, so a rough comparison only:
main→ this branchaxe finds zero violations on the Settings sheet.
A high-effort code review found 10 issues, all fixed.
Needs a human
verify/ab/).🤖 Generated with Claude Code