Repository navigation
英語TTSで「Keisei」が「かいせい」と読まれる誤読を読み上げ直前の表記置換で修正 - #6869
Conversation
Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01WS1LSBnYTMfm7CyrzqKxuW
|
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 (4)
Included review availability: 4 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour. 📝 WalkthroughWalkthrough英語TTS向けに、 Changes英語読み補正
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to English TTS input now changes standalone “Keisei” to “Kay-say” while Japanese and display text remain unchanged. The added focused and integration coverage indicates no remaining merge-blocking risk. Sequence Diagram(s)sequenceDiagram
participant TTSCaller
participant toSpeakableText
participant fixEnglishReading
TTSCaller->>toSpeakableText: 英語テキスト
toSpeakableText->>fixEnglishReading: 日本語文字を除去したテキスト
fixEnglishReading-->>toSpeakableText: Keisei を Kay-say に補正
toSpeakableText-->>TTSCaller: 発話可能テキスト
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
概要
英語アナウンスで「Keisei(京成)」が「かいせい」と読み上げられる誤読を、SSML を使わずに修正します。既存の「JR → J-R」置換(
fixJrReading)と同じく、読み上げ直前のプレーンテキストに対して TTS エンジンが確実に読める表記へ置換する方式です。変更の種類
変更内容
src/utils/englishReading.tsを新設し、英語の読み上げテキスト専用の固有名詞読み替え表とfixEnglishReadingを追加。現状のルールはKeisei→Kay-sayの 1 件Kaysei)だとエンジンごとの G2P 推定に戻ってぶれるため、読み替え先は辞書語のハイフン連結に限定する方針をコメントに明記Keisei Main Line/Keisei-Ueno/Keisei Electric Railway/Keisei Busはすべて置換され、Keiseibusのような別語の一部は置換しないsrc/utils/speakableText.tsのtoSpeakableTextで、英語経路の最後にfixEnglishReadingを通すよう変更。ネイティブ TTS(expo-speech)とリモート TTS(Google Cloud TTS)の両方がこの関数を経由するため、どちらの経路でも効く。日本語文は<sub alias>のカタカナ読みが使われるので対象外。表示用テキストには影響しないsrc/utils/englishReading.test.tsを新設、src/utils/speakableText.test.tsに英語文の置換と日本語文の非対象ケースを追加レビュー時の留意点
Kay-sayの実際の聞こえ方は実機では未確認です。iOS / Android / リモート音声のいずれかで不自然な場合は、ENGLISH_READING_RULESの読み替え先を差し替えるだけで調整できますテスト
npm run lintが通ることnpm testが通ることnpm run typecheckが通ることローカル実行結果(Node 24.20.0 / npm 11.19.0):
関連Issue
スクリーンショット(任意)
UI 変更なし:
src/utils/**の読み上げテキスト生成ロジックのみの変更で、画面表示には変化がありません🤖 Generated with Claude Code
https://claude.ai/code/session_01WS1LSBnYTMfm7CyrzqKxuW
Generated by Claude Code
Summary by CodeRabbit
新機能
テスト