v1.4.3: 상대 닉네임을 말로 적던 문제 ("QQQWWWQ")

- 선수 이름은 한글이 들어간 것만 핫워드로 넣는다
- 결과가 선수 이름(조각)뿐이면 워커가 이름을 빼고 다시 변환 (is_name_echo, player_names)
- 예전에 이렇게 적힌 발화는 한 번만 정밀 모델로 다시 변환 (파일 없으면 숨김, 고친 발화 제외)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
EJClaw
2026-10-17 00:30:21 +09:00
parent a4511a8eaf
commit 010d2475cc
8 changed files with 299 additions and 22 deletions

View File

@@ -15,3 +15,33 @@ def test_normal_sentence_with_some_hotwords_is_kept():
assert not is_hotword_echo("드래곤 가자 바텀으로 모여", HW)
assert not is_hotword_echo("바론 치자 시야 잡아줘", HW)
assert not is_hotword_echo("포탑 밀자", HW)
# 선수 이름 되풀이 (v1.4.3): 상대 닉네임 "QQQWWWQQQ" 를 핫워드로 넣었더니 말소리를 "QQQWWWQ" 로 적었다
from gvr_worker.stt import _without_names, is_name_echo # noqa: E402
NAMES = ["QQQWWWQQQ", "노곤노곤탐방가", "하늘 별"]
def test_name_echo_detected_for_name_or_fragment():
assert is_name_echo("QQQWWWQ", NAMES)
assert is_name_echo(" QQQWWWQ.", NAMES)
assert is_name_echo("qqqwwwqqq", NAMES)
assert is_name_echo("QQQWWWQ QQQWWWQ", NAMES)
assert is_name_echo("노곤노곤탐방가", NAMES)
assert is_name_echo("하늘 별", NAMES)
def test_name_echo_not_for_real_speech():
assert not is_name_echo("QQQ 잡았다", NAMES)
assert not is_name_echo("노곤노곤탐방가 죽였어", NAMES)
assert not is_name_echo("아이고, 점프티... 아, 갔다.", NAMES)
assert not is_name_echo("Q", NAMES)
assert not is_name_echo("", NAMES)
assert not is_name_echo("QQQWWWQ", [])
def test_without_names_keeps_other_hotwords():
assert _without_names("제트 레이즈 QQQWWWQQQ 하늘 별 로테", NAMES) == "제트 레이즈 로테"
assert _without_names("QQQWWWQQQ", NAMES) is None
assert _without_names(None, NAMES) is None