From 5f7d4890ae29f39604d336397811a403d71cbb6b Mon Sep 17 00:00:00 2001 From: kim Date: Mon, 19 Oct 2026 23:51:08 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9D=8C=EC=84=B1=20=EB=82=AD=EB=8F=85:=20?= =?UTF-8?q?=EC=9B=B9=20=EC=A3=BC=EC=86=8C=C2=B7=EB=8F=84=EB=A9=94=EC=9D=B8?= =?UTF-8?q?=EC=9D=84=20'=EC=9D=B8=EB=B2=A0=EC=8A=A4=ED=8C=85=20=EB=8B=B7?= =?UTF-8?q?=EC=BB=B4'=EC=B2=98=EB=9F=BC=20=EC=9D=BD=EA=B8=B0(=EA=B2=BD?= =?UTF-8?q?=EB=A1=9C=20=EC=83=9D=EB=9E=B5,=20=EB=8F=84=EB=A9=94=EC=9D=B8?= =?UTF-8?q?=20=EC=A0=90=EC=97=90=EC=84=9C=20=EB=AC=B8=EC=9E=A5=20=EC=95=88?= =?UTF-8?q?=20=EB=81=8A=EC=9D=8C)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 5.5 --- web-ui/js/voice/voice-call.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/web-ui/js/voice/voice-call.js b/web-ui/js/voice/voice-call.js index 8e946b2..803e970 100644 --- a/web-ui/js/voice/voice-call.js +++ b/web-ui/js/voice/voice-call.js @@ -444,6 +444,19 @@ return _NATIVE_HOUR[n] ? _NATIVE_HOUR[n] + suffix : m; } + const _TLD_KO = { com: '컴', net: '넷', org: '오알지', io: '아이오', kr: '케이알', gov: '거브', edu: '에듀', ai: '에이아이', dev: '데브', app: '앱', me: '미', tv: '티비', info: '인포', biz: '비즈' }; + function _domainToSpeech(host) { + const parts = String(host).toLowerCase().split('.'); + const out = []; + for (let i = 0; i < parts.length; i++) { + const p = parts[i]; + if (i === 0) { out.push(p.replace(/-/g, ' ')); continue; } + if ((p === 'co' || p === 'or' || p === 'go') && parts[i + 1] === 'kr') { out.push('닷 ' + { co: '씨오', or: '오알', go: '지오' }[p]); continue; } + out.push('닷 ' + (_TLD_KO[p] || p)); + } + return ' ' + out.join(' ').replace('닷 컴', '닷컴').replace('닷 넷', '닷넷') + ' '; + } + function sanitizeForSpeech(text) { text = window.spellUnitsForSpeech ? window.spellUnitsForSpeech(text) : text; // g/kg/GB/Hz… 단위 낭독(speech-units.js) return text @@ -469,6 +482,9 @@ .replace(/^\s*\|?\s*:?-{2,}:?\s*(\|\s*:?-{2,}:?\s*)*\|?\s*$/gm, ' ') // remaining table rows: "| a | b |" -> "a, b" so cells read as a list .replace(/^\s*\|(.+)\|\s*$/gm, (_m, row) => row.split('|').map((c) => c.trim()).filter(Boolean).join(', ')) + // 웹 주소는 도메인만 "인베스팅 닷컴"처럼 읽는다(경로·쿼리는 생략). www.는 뺀다. + .replace(/https?:\/\/(?:www\.)?([A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)+)[^\s)\]]*/g, (_m, host) => _domainToSpeech(host)) + .replace(/\b(?:www\.)?([A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)*\.(?:com|net|org|kr|io|gov|edu|co\.kr|or\.kr|go\.kr|ai|dev|app|me|tv|info|biz))(?![A-Za-z])/gi, (_m, host) => _domainToSpeech(host)) .replace(/https?:\/\/\S+/g, ' ') // OmniVoice reads a bare "°C"/"°F" as "그램"(grams) instead of degrees // — the digits (even with a decimal point) come through fine once the @@ -613,6 +629,8 @@ // 따로 읽혀 소수점·앞자리가 사라진다(2026-10-19 "소숫점 앞의 숫자가 빠진다"). 숫자 뒤 마침표가 버퍼 끝이면 더 받을 때까지 둔다. // 턴이 끝나면 남은 꼬리는 별도로 낭독된다(finalText 경로). if (text[i] === '.' && /\d/.test(text[i - 1] || '') && i === text.length - 1) break; + // 도메인의 점("investing.com")도 문장 끝이 아니다. + if (text[i] === '.' && /[A-Za-z0-9]/.test(text[i - 1] || '') && /^(?:com|net|org|kr|io|gov|edu|co|ai|dev|app|me|tv|info|biz|go|or|ne|ac)(?![A-Za-z])/i.test(text.slice(i + 1, i + 6))) continue; if (/[.!?\n]/.test(text[i])) { const boundaryChar = text[i]; let j = i + 1;