summaryrefslogtreecommitdiff
path: root/server/internal
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-10-29 23:46:35 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-10-29 23:46:35 +0000
commitc45ea4b5167d427db87ea6ad94c891e75f5275d4 (patch)
treeb1c7f05e4dc52ffa59ddfa9edcf13c35e89dc48e /server/internal
parent247c6a6456173e4ec67b6f95191765a2cf62b744 (diff)
Judge a short line on a shorter run, and catch a bare music note
Printing the first line of all 65 pods in the corpus found the one failure that actually matters -- a break opening on the programme -- in about eight of them. Three were identical: "I'm Jack Resider.", which is the Darknet Diaries host saying his own name, misheard. Rhysider is not a word whisper knows. Four words out of four means one misheard word anywhere in a short line hides the whole line from the master, so it is never given back. Three of "i m jack resider" still finds "i m jack" where the publisher wrote "I'm Jack Rhysider". Short lines are now judged on three; long ones are unchanged, where a full run is affordable and a looser one would match by accident. The annotation pattern also missed a bare "♪", which is a music note without brackets round it. Measured across the eighteen episodes holding a master: before 99% - 106%, mean 101% after 92% - 104%, mean 100% The three that fell furthest are the three Darknet Diaries episodes, and they fell because the host's sentence is no longer inside the break. Falling below the length gap is the right answer there: the gap counts advertising, and his name was never advertising. Eight suspect pod openings are down to four, and all four are now either a one-word line too short to judge at all ("Yay!", "- Pessimism.") or a line that is mostly advertisement with a second of handoff in front of it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018AwnALZL6bD4VBtATDVv3B
Diffstat (limited to 'server/internal')
-rw-r--r--server/internal/transcript/trim.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/server/internal/transcript/trim.go b/server/internal/transcript/trim.go
index f2ded4c..a853800 100644
--- a/server/internal/transcript/trim.go
+++ b/server/internal/transcript/trim.go
@@ -40,6 +40,9 @@ const (
// errs towards smaller candidates, which is the safe direction: a skip into the programme
// is worse than a missed advertisement.
trimRunWords = 4
+ // shortLineWords is where a line is short enough that requiring a full-length run would
+ // mean requiring nearly all of it to be heard correctly.
+ shortLineWords = 5
// trimMinWords is the shortest line this can judge. A two-word line gives nothing to look
// for, so it is kept rather than guessed at, which is what leaves the music markers alone.
trimMinWords = 3
@@ -92,7 +95,7 @@ func trimmed(found []Candidate, master, served []Cue) []Candidate {
// never anchor -- which leaves them sitting at the front of a break, widening it. Unlike a
// title card, which this deliberately leaves alone, an annotation says what it is by its shape,
// so it can be told from an advertisement without guessing.
-var annotation = regexp.MustCompile(`^\s*[\[(][^\])]{0,40}[\])]\s*$`)
+var annotation = regexp.MustCompile(`^\s*(?:[\[(][^\])]{0,40}[\])]|[\x{266a}\x{266b}\x{2669}\x{266c}\s]+)\s*$`)
// inMaster reports whether a line's words appear in the master.
// trimmable reports whether a line at the edge of a break belongs to the break.
@@ -105,7 +108,14 @@ func inMaster(cue Cue, runs map[string]bool) bool {
if len(words) < trimMinWords {
return false
}
+ // A short line is judged on a shorter run. Four words out of four means one misheard word
+ // anywhere in it hides the whole line -- which is how "I'm Jack Rhysider" came back as
+ // "I'm Jack Resider" and opened three Darknet Diaries breaks on the host's own sentence.
+ // Three of "i m jack resider" still finds "i m jack" in the master.
size := trimRunWords
+ if len(words) <= shortLineWords {
+ size = trimMinWords
+ }
if len(words) < size {
size = len(words)
}