You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Keep the transcript at one word per timed <span> as the user edits, so timings stay attached to the right words and manual fixes to stray fragments "just work". Three cases:
Edit a letter inside a word → stays the same span (already holds via contenteditable).
Split — type a space inside a word → split into one span per word. Already implemented:splitWordSpan (js/editor-core.js, on blur) divides the original [data-m, data-d] by syllable/vowel-group weight (deliberately not letter count).
Join — delete the space between two words → merge the two spans into one. This is the gap: today the space is removed but the two <span>s remain, leaving two data-m windows behind one visual word.
Why it matters
This is the general, deterministic fix for split-word fragments (E+ditor, Hypera+udio) regardless of source — cloud engine, SRT/VTT import, or manual paste: the user just deletes the space and the editor merges the spans correctly. It removes the need for a fragile auto-detector.
Merge rule (inverse of the split)
Merging span A (m_a, d_a) with the following span B (m_b, d_b):
merged data-m = m_a
merged data-d = (m_b + d_b) − m_a
merged text = A + B with the internal space removed (keep the trailing space)
generalises to N joined spans: start of the first, end of the last.
Runs on blur, mirroring the existing split pass; touches only affected spans.
Notes
Case 1 already holds; add a guard/test so an edit can't silently orphan or duplicate a span.
Optional/secondary: a best-effort "tidy" that flags likely ASR fragments — but with join-merge in place that's convenience, not the mechanism, and must stay conservative (don't merge real short words: "I am", "a cat").
The local Parakeet worker's ▁-based subword merge is unaffected (clean signal, keeps working).
Reference: the default demo transcript's fragments were fixed by hand twice using the merge rule above.
Summary
Keep the transcript at one word per timed
<span>as the user edits, so timings stay attached to the right words and manual fixes to stray fragments "just work". Three cases:contenteditable).splitWordSpan(js/editor-core.js, on blur) divides the original[data-m, data-d]by syllable/vowel-group weight (deliberately not letter count).<span>s remain, leaving twodata-mwindows behind one visual word.Why it matters
This is the general, deterministic fix for split-word fragments (
E+ditor,Hypera+udio) regardless of source — cloud engine, SRT/VTT import, or manual paste: the user just deletes the space and the editor merges the spans correctly. It removes the need for a fragile auto-detector.Merge rule (inverse of the split)
Merging span A
(m_a, d_a)with the following span B(m_b, d_b):data-m=m_adata-d=(m_b + d_b) − m_aRuns on blur, mirroring the existing split pass; touches only affected spans.
Notes
▁-based subword merge is unaffected (clean signal, keeps working).