Text normalization and sentence chunker #6
Labels
No labels
NaNs
area/audio
area/build
area/docs
area/dsh
area/engine
area/security
area/ui
needs-operator
priority/later
priority/next
priority/now
type/bug
type/task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
dsh-plugins/dsh-whale-noises#6
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Turn markdown into speakable sentences. Pure, deterministic, unit-tested — no DOM, no engine.
Scope
normalize(text)— drop fenced/inline code, tables, HTML, link targets (keep link text), bare URLs, emoji; collapse whitespace; expand a small safe set of symbols (&→ and,%→ percent,->→ to). Keep it conservative; no re-writing of prose.chunk(text, maxChars)— sentence splitter on. ! ? …+ CJK。!?and paragraph breaks, with guards for abbreviations (Mr.,e.g.,i.e.,vs.,Dr.), decimals (3.14), and list markers; hard-split anything overmaxCharsat word boundaries.maxChars = 400(Piper's library chunking); expose per-engine limits (API: 4096).Acceptance
Notes
Done in
468e565.src/text.jsexposesnormalizeText+chunkText; 13 table-driven tests cover fences/inline code, tables, links/URLs, emoji, symbols, abbreviations, decimals, CJK, umlauts, 3 000-char hard splits and oversized tokens. CI run #4 green.Note: the ##6 subagent disappeared mid-task; the Lead implemented this directly. Test count now 78 total.