Drop-video button (blocks reruns), manual title, striped recording groups, collapse whisper loops, fix report _clean name clash
This commit is contained in:
+4
-2
@@ -17,14 +17,16 @@ def _log(msg):
|
||||
|
||||
|
||||
def aggregate(segs):
|
||||
"""(start,end,text) -> [(sec,text)]: flush on end punctuation, >1s gap, or >12s run."""
|
||||
lines, buf, start, end = [], [], 0, 0
|
||||
"""(start,end,text) -> [(sec,text)]: flush on end punctuation, >1s gap, or >12s run. A segment repeated 3+ times in a row is a whisper loop (46x "Ciao."): keep 2."""
|
||||
lines, buf, start, end, last, rep = [], [], 0, 0, None, 0
|
||||
def flush():
|
||||
if buf:
|
||||
lines.append((int(start), " ".join(buf))); buf.clear()
|
||||
for s, e, t in segs:
|
||||
t = t.strip()
|
||||
if not t: continue
|
||||
rep = rep + 1 if t == last else 0; last = t
|
||||
if rep >= 2: continue
|
||||
if buf and s - end > 1: flush()
|
||||
if not buf: start = s
|
||||
buf.append(t); end = e
|
||||
|
||||
Reference in New Issue
Block a user