Skip to content

知了 Cicada · 任何会议和直播的实时字幕、同声传译、AI 会议纪要,Mac、Windows、Linux、Android 免费开源。Live subtitles, interpreting and meeting notes for any call or stream, on Mac, Windows, Linux and Android.

fix(windows): saying yes to a fixed name fixes the rest of the meeting heard the same way at once, not only with the next line

wqugurue38bd1be856c
diff --git a/windows/src/Cicada.Core/LiveFixes.cs b/windows/src/Cicada.Core/LiveFixes.cs
index 1f2ab5d..a2176b0 100644
--- a/windows/src/Cicada.Core/LiveFixes.cs
+++ b/windows/src/Cicada.Core/LiveFixes.cs
@@ -168,10 +168,19 @@ public sealed class LiveFixes
if (store.Get(id) is not { } s) return;
bool Waiting(LineFix f) => f.Ask == true && Correction.Core(f.From, f.To) == c;
var touched = s.Lines.Where(l => (l.Fixes ?? []).Any(Waiting)).ToList();
- Remember(id, touched.Select(l => l.Id));
+ var others = yes ? s.Lines.Where(l => l.Src.Contains(c.From, StringComparison.Ordinal) && !touched.Contains(l)).ToList() : [];
+ Remember(id, touched.Concat(others).Select(l => l.Id));
foreach (var l in touched)
Set((l.Fixes ?? []).Select(f => Waiting(f) ? f with { Ask = null, User = yes ? true : f.User, Off = yes ? f.Off : true } : f).ToList(), l.Id, id);
- if (yes) Vocabulary.Confirm(c.From, c.To); else refused.Add(Pair(c.From, c.To));
+ if (yes)
+ {
+ Vocabulary.Confirm(c.From, c.To);
+ // The rest of the meeting heard the same way follows now, not with the next line.
+ if (settings.FixMisheard)
+ foreach (var l in others)
+ if (Line(id, l.Id) is { } now) Set(Known(now.Src, now.Fixes ?? []), l.Id, id);
+ }
+ else refused.Add(Pair(c.From, c.To));
}
Log.Debug($"fix answered {(yes ? "yes" : "no")}");
Say(yes ? Strings.LF("已改 %@ → %@,记进词表", c.From, c.To) : Strings.LF("这场不再问 %@", c.From));
diff --git a/windows/tests/Cicada.Tests/Program.cs b/windows/tests/Cicada.Tests/Program.cs
index f02eb98..3a4528c 100644
--- a/windows/tests/Cicada.Tests/Program.cs
+++ b/windows/tests/Cicada.Tests/Program.cs
@@ -2980,6 +2980,16 @@ static class Tests
Equal("但质压这种", FixLine(store, id, "l0").Shown, "stays reverted");
}
+ public static void FixesYesFixesTheRestOfTheMeetingAtOnce()
+ {
+ var (fx, store, id) = FixSetup("最近那个开布特提了", "开布特那边也说了");
+ fx.Received(id, "l0", [new("开布特", "Curve", 0.9)]);
+ fx.Answer(fx.Pending(id)[0].Fix, true, id);
+ Equal("Curve那边也说了", FixLine(store, id, "l1").Shown, "the other line follows at once");
+ fx.Undo();
+ Equal("开布特那边也说了", FixLine(store, id, "l1").Shown, "undo takes it back");
+ }
+
public static void FixesOffLeavesLinesAsHeard()
{
var (fx, store, id) = FixSetup("但质压这种");