회기 후속 검증과 표시 경계 보강

This commit is contained in:
Yun Chan 2026-08-10 01:55:21 +09:00
parent 4cd354881f
commit aa81af2958
10 changed files with 70 additions and 21 deletions

View file

@ -54,6 +54,15 @@ export function displayPiiSafeText(text: string) {
/\[NAME\]는 건지\s+잘 \[NAME\]는데요/g,
"되는 건지 잘 모르겠는데요",
);
// 평가 문장에 이미 역할 명사가 있으면 이름 토큰을 다시 "익명 내담자"로
// 풀지 않는다. 특히 "내담자 [NAME]을 받을 여백"은 저장 마스킹 뒤
// 사람에게 "내담자 반응을 받을 여백"으로 보여야 한다.
next = next
.replace(/내담자\s+\[NAME\](?:을|를)/g, "내담자 반응을")
.replace(/내담자\s+\[NAME\](?:이|가)/g, "내담자가")
.replace(/내담자\s+\[NAME\](?:은|는)/g, "내담자는")
.replace(/내담자\s+\[NAME\]의/g, "내담자의")
.replace(/내담자\s+\[NAME\]/g, "내담자");
for (const [placeholder, label] of Object.entries(DISPLAY_PLACEHOLDERS)) {
next = replacePlaceholderWithNaturalParticle(next, placeholder, label);
}