Improve command, cup task and talk understanding in English and Korean
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -203,4 +203,27 @@ if __name__ == "__main__":
|
||||
assert brain._follow_examples(t, h), t
|
||||
for t in ("Where is p3?", "세종대왕이 누구예요?", "oh cool", "What's your name?", "Tell me about the Korean War."):
|
||||
assert not brain._follow_examples(t, h), t
|
||||
# a world subject keeps Lumi's notes out (also lower-case English and a part named after it); Lumi's own things keep them
|
||||
b = brain.Brain()
|
||||
for h, t, want in (([], "Why do whales sing?", ["whales"]), ([], "부엉이는 고개를 몇 도까지 돌려요?", ["부엉이"]),
|
||||
([("Why do whales sing?", "ACTION: none -\nTo find mates.")], "How far can the song go?", ["whales"]),
|
||||
([("문어는 다리가 몇 개고?", "ACTION: none -\n여덟 개예요.")], "심장은 몇 개고?", ["문어", "다리", "심장"]),
|
||||
([], "속도는 얼마예요?", []), ([], "How fast can you go?", []), ([], "Is the song yours?", []),
|
||||
([], "Can the arm lift 2 kg?", [])):
|
||||
b.history = list(h)
|
||||
assert b.world_talk(t) == want, (t, b.world_talk(t))
|
||||
# "really?" after a turn Lumi did not catch asks about the answer before it
|
||||
h = [("롯데월드타워 높이 몇 m예요?", "ACTION: none -\n555미터예요."),
|
||||
("uh... what was it... 그...", "ACTION: unclear -\n죄송해요, 다시 말씀해 주시겠어요?")]
|
||||
assert brain.topic_turn(h)[0].startswith("롯데월드타워"), brain.topic_turn(h)
|
||||
# the model's "search" with its answer after it: said (none); a lookup promise or "don't know" keeps the search
|
||||
s = {"action": "search", "target": "x"}
|
||||
q = "윤초는 뭐예요?"
|
||||
for w in ("윤초는 지구 자전과 시계를 맞추는 1초예요.", "Mount Fuji is 3,776 metres high."):
|
||||
assert brain.Brain._settled(s, w, q)["action"] == "none", w
|
||||
for w in ("확인해 볼게요.", "Let me check.", "search whale song distance", "잘 모르겠어요.", "", "윤초는 뭐예요?",
|
||||
"윤초가 궁금하시군요. 잠시만요.", "What exactly do you mean?"):
|
||||
assert brain.Brain._settled(s, w, q) is s, w
|
||||
assert brain.CHANGES.search("지금 비트코인 얼마야?") and brain.CHANGES.search("Who won the game yesterday?")
|
||||
assert not brain.CHANGES.search("윤초는 뭐예요?") and not brain.CHANGES.search("How do bees dance?")
|
||||
print("followup ok")
|
||||
|
||||
Reference in New Issue
Block a user