英語TTSでMineを「マイン」と読む誤読を端末内蔵TTS向けの読み替え表に追加して修正 - #7015
Conversation
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Essentials Run ID: 📒 Files selected for processing (2)
Included review availability: 0 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour. 📝 WalkthroughWalkthrough
ChangesMine 読み替え
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: 🔵 Low · up to Native English speech can mispronounce ordinary text containing “mine.” Restrict the replacement to the intended station-name romanization before merging. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption. うさぎは Mine をぴょんと読み替え Comment |
概要
英語 TTS が「Mine(美祢・峰など)」を英単語の "mine" として「マイン」と読んでしまう問題を、端末内で読み上げる経路でも直します。
リモート TTS 側は TrainLCD/Functions#42 で
normalizeRomanTextに同じ置換を入れています。ただ、Remote Config でリモート TTS が無効な回や、リモート合成に失敗してフォールバックした回は、英語を端末内で読み上げます(Android は端末内蔵 TTS、iOS は VITS)。この経路はアプリのfixEnglishReadingしか通らないため、アプリ側にも同じ置換が必要です。変更の種類
変更内容
src/utils/englishReading.ts: 読み替え表にmineを追加しました。Me-nayです。Keisei →Kay-say、Seibu →Say-booと同じく、英語の辞書語をハイフンでつないだ綴りにしています。replaceMineと同じ規則です。Ōなどのラテン拡張文字も語の一部として扱います。src/utils/englishReading.test.ts: 置き換える例・置き換えない例・2回続けて適用しても結果が変わらないことを確かめるケースを追加しました。変換例
Change here for the Mine Line.Change here for the Me-nay Line.The next station is Nishi-Mine.The next station is Nishi-Me-nay.TsurugamineTsuruga-me-nayMitsumineguchiMitsu-me-nay-guchiMinenobuMe-nay-nobuMinami-ŌmineMinami-Ō-me-nayMinami-UrawaMinami-Urawa(mine を含まないので変わりません)リモート TTS に送る英文には、この置換を掛けません。置換はサーバー側の
normalizeRomanTextに任せ、キャッシュキーを原文に揃えるという既存の方針のままです(src/utils/speakableText.ts)。テスト
npm run lintが通ることnpm testが通ることnpm run typecheckが通ることnpm testは、englishReadingとtoSpeakableTextを使うモジュールのテストに絞って実行しました(9 suites / 230 tests がすべて通過)。実機での音声はまだ聞いていません。関連Issue
スクリーンショット(任意)
UI 変更なし:
src/utils/**の読み上げ用テキストの変換だけを変えており、画面表示に変化はありません。🤖 Generated with Claude Code
Summary by CodeRabbit