Repository navigation
fix(transcription): restore Arabic punctuation onto unpunctuated words - #552
Conversation
…punctuation Both cases fail on 9ef1834: we’ll takes the comma of the Well before it, and Arabic ، ؛ ؟ are dropped.
…rom Arabic marks Keys read a curly apostrophe as a straight one, so we’ll is not well, and the closing marks include ، ؛ ؟. Budgets rise to the measured 334,117 raw and 109,265 gzip bytes.
|
FAIL
|
…ouped with one A word that ends at an apostrophe inside its token moves past it, so we and ll both fall in we'll, and an apostrophe between digits is dropped from the key. Budgets rise to the measured 334,180 raw and 109,299 gzip bytes.
|
On the 66ea40b verdict: fixed in 3e44ed3. The verifier was right that this PR caused it. Once
Your three examples now save as
|
|
FAIL
|
…exact spelling Words match the text with apostrophes dropped, so 90s finds 90’s, 1000 finds 1’000 and rock n roll finds rock'n'roll, which replaces the apostrophe skip and the digit rule. A word that matches a whole token only that way, as its does It's, moves to a later token in reach that spells it exactly, which keeps we’ll off a nearby Well,. Budgets rise to the measured 334,318 raw and 109,351 gzip bytes.
|
On the 3e44ed3 verdict: fixed in 412f4c1 by changing the rule instead of adding another shape.
Your case now saves
|
|
FAIL
|
…arks Three independent verifier rounds each found a case where a new apostrophe rule lost or misplaced a mark that master restores: words split at an apostrophe, 90s against 90’s, and 90s twice against 90’s. 90s!. Which token a word with or without an apostrophe belongs to cannot be told without context, and the real Qwen3 answers never hit it. Matching goes back to master's, so a curly we’ll can still take a nearby omitted Well,'s comma, as before. Budgets are the measured 334,097 raw and 109,248 gzip bytes.
|
On the 412f4c1 verdict: you were right, and this is the third apostrophe rule an independent verifier has failed. No matching rule can tell, without context, whether a word belongs to a token that differs from it only by an apostrophe. So 3907092 reverts the matching to master's, and gap 1 (a curly |
|
PASS+NOTES
|
Budgets are the measured 334,171 raw and 109,282 gzip bytes: master's 334,165 and 109,270 plus the Arabic marks.
Summary
Follow-up to #544 for 2.25.1. Some answers from Qwen3 ASR, and from OpenAI-compatible servers, list bare words and keep the punctuation in
text. PodNotes puts that punctuation back on the words. The verifier on #544 accepted four gaps. This PR fixes one and explains why the other three stay open.Not changed: a curly contraction can take a nearby comma. With
textWell, we’ll see.and wordswe’ll see, the note readswe’ll, see.. I tried three rules, and an independent verifier failed each one with a case master gets right:’lost the marks of words split at an apostrophe (Rock n rollagainstRock’n’roll!).90sagainst90’s..90’s. 90s!onto the wrong90s.Which token a word belongs to when the two differ only by an apostrophe cannot be told without context. The real Qwen3 answers never hit it either: their words and text agree on every apostrophe (87 of 87 and 97 of 97). Matching stays as on master.
Fixed: Arabic
،؛؟were dropped. They are now in the closing marks (TRAILING), which also restores the Urdu؟. No word can already hold one, because a word with a mark keeps the whole answer as given (PLAIN_WORD), so none can be added twice.Not changed: more than 200 tokens of filler stop the restore for the rest of the answer. I replayed the two real Qwen3 answers from feat(transcription): offer Voxtral Mini Transcribe 3 and Qwen3 ASR on OpenRouter #544 (Up First, 2,262 words, and Planet Money, 3,785 words) with the resync window at 3, 4, 6, 10, 20, 50, 200 and unbounded. Every run restored the same marks, 301 of 311 and 612 of 616. A wider window brings back the quadratic worst case feat(transcription): offer Voxtral Mini Transcribe 3 and Qwen3 ASR on OpenRouter #544 measured (2.2 s for 17,500 unmatched words).
Not changed: one non-plain word turns the restore off for the whole answer. The real answers have 0 non-plain words out of 6,047. Restoring around such words is the boundary behind most of feat(transcription): offer Voxtral Mini Transcribe 3 and Qwen3 ASR on OpenRouter #544's doubled-punctuation rounds. It would also change notes from Grok, Scribe v2 and MAI, which share this reader. The existing test
keeps every Qwen word as given when one has a symbol, an emoji, a quote or an end apostrophepins the current behavior.The verify skill's fixture now answers Qwen3 ASR with bare words, as the real model does. Before this, the fixture never exercised the restore end to end.
Verification
gives Qwen's words Arabic punctuation from its textfails on 9ef1834 withمرحبا كيف حالك أنا بخير شكرا..npm run plantwith،؛؟removed fromTRAILINGmakes it fail, and it passes again once the file is restored.A replay of the reader on master and this head covers every case the three verifiers raised, plus 420 generated quote and apostrophe shapes. Every output is identical to master, except Arabic and Urdu, which gain their marks. Both real Qwen3 answers are byte-identical to master.
Obsidian 1.14.4 on Linux, isolated instance, fake OpenRouter key, Qwen3 ASR 1.7B. I played
Fixtures/Local Fixture.wavwith "Play with PodNotes" and ran "Transcribe current episode from audio" from the palette, withnet.mjs watch --turnstextWell, we’ll see. ‘Okay.’ Bye.andمرحبا، كيف حالك؟ أنا بخير؛ شكرا.:مرحبا كيف حالك أنا بخير شكرا.مرحبا، كيف حالك؟ أنا بخير؛ شكرا.dev:errorsshowed no errors.npm run lint,format:check,typecheck,build,size,test(2,993) andtest:tooling(56) pass, run withfnm exec --using 22.23.2. I skippeddocs:buildbecause no docs changed.Size: on top of master, the budgets rise by the measured 6 raw and 12 gzip bytes, to 334,171 and 109,282.
An independent verifier (GPT 6 Astra) gave PASS+NOTES at 3907092. Merging master after that changed only the size budgets and one line of the verify recipe. The reader, test and fixture patch is unchanged (same
git patch-id).Release impact
None. No settings, storage, API or URI changes.
Note
Low Risk
Localized change to punctuation matching for unpunctuated ASR words; no auth, storage, or API surface changes.
Overview
Extends the verbose JSON punctuation restore in
verboseJson.tsso closing Arabic marks (،؛؟, including Urdu؟) are applied when Qwen3 ASR and OpenAI-compatible servers return bare words with punctuation only intext.Adds a unit test for Arabic text and updates the verify fixture (
net.mjs) so Qwen3 ASR responses omit word-level punctuation like the live model, with matching notes intranscripts.md.Bundle budgets rise by 6 raw and 12 gzip bytes (334,171 / 109,282) in
size.mjs, tests,AGENTS.md, andsize-baseline.md.Reviewed by Cursor Bugbot for commit bbeccc4. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix trailing punctuation restoration for unpunctuated Qwen transcription words
verboseJson.ts, so a token's closing punctuation is assigned to its last word and opening punctuation to its first word. This restores Arabic punctuation that Qwen omits from word tokens but keeps in the response text.Macroscope summarized bbeccc4.