Repository navigation
TTS の乗換案内で同じ路線名を繰り返し読み上げないよう重複を除外 - #5930
Merged
Merged
Conversation
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthrough新しいヘルパー関数 ChangesTTS重複排除機能
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
TTS の乗換案内で、データ上は方面別に同じ路線名が複数レコード登録されているケース (例: 博多駅の鹿児島本線) で、同じ路線名が連続して読み上げられていた挙動を、TTS パイプライン側で 1 回だけに集約するよう修正します。表示用の経路情報には影響させず、TTS 直前でのみ重複を除外します。
変更の種類
変更内容
src/hooks/tts/formatters.ts:nameShort(fallback でnameRoman) が一致するLineを最初の出現だけ残すdedupeLinesByTtsNameを追加。useTransferLinesFromStation側で既に括弧書きが落とされているため、生の文字列比較で十分に機能する。src/hooks/useTTSText.ts:useTransferLinesの結果をdedupeLinesByTtsNameでメモ化したttsTransferLinesを経由させ、hasTransferLines/transferLinesListJa/transferLinesEnListの組み立てに使用。表示系コンポーネント (LineBoard*/Transfers等) は従来どおり元のtransferLinesを参照するため、画面上は両レコードが残る。src/hooks/tts/formatters.test.ts:dedupeLinesByTtsNameの単体テストを追加 (博多駅の鹿児島本線重複ケース、順序維持、nameRomanフォールバック、キー欠落時の挙動)。テスト
npm run lintが通ることnpm testが通ることnpm run typecheckが通ることnpx cross-env TZ=UTC jest --testPathPattern="(formatters\.test|useTTSText\.test|useTransferLines)"で 4 suites / 110 tests pass を確認。関連Issue
スクリーンショット(任意)
Summary by CodeRabbit
新機能
テスト