fix: 路線名IPAの接尾辞を英語IPAに置換#1413
Merged
Merged
Conversation
Instead of just removing 線/本線/支線 from the IPA, replace them with their English IPA equivalents (laɪn / meɪn laɪn) so that Google TTS correctly pronounces the line type in English. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
📝 WalkthroughWalkthrough
Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
Contributor
There was a problem hiding this comment.
🧹 Nitpick comments (1)
stationapi/src/use_case/dto/line.rs (1)
11-15:name_ipaの新仕様に対するDTO層テストを追加してください。実装は良いですが、この変更点(英語IPA接尾辞の連結・Shinkansen例外)をこのファイルのテストで直接検証していないため、将来の回帰を検知しづらいです。
テスト追加例
+ #[test] + fn test_line_to_grpc_line_name_ipa_appends_line_suffix() { + let line = create_test_line(TransportType::Rail, None); + let grpc_line: GrpcLine = line.into(); + assert!(matches!( + grpc_line.name_ipa.as_deref(), + Some(s) if s.ends_with(" laɪn") + )); + } + + #[test] + fn test_line_to_grpc_line_name_ipa_shinkansen_has_no_english_suffix() { + let mut line = create_test_line(TransportType::Rail, None); + line.line_name_k = "トウホクシンカンセン".to_string(); + let grpc_line: GrpcLine = line.into(); + assert!(matches!( + grpc_line.name_ipa.as_deref(), + Some(s) if !s.ends_with(" laɪn") && !s.ends_with(" meɪn laɪn") + )); + }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@stationapi/src/use_case/dto/line.rs` around lines 11 - 15, name_ipa の新仕様(replace_line_name_suffix と katakana_to_ipa を組み合わせて英語IPA接尾辞を連結し、Shinkansen 系の例外処理が正しく動くこと)を検証する DTO 層の単体テストを追加してください: stationapi/src/use_case/dto/line.rs にある name_ipa 算出ロジックをテスト対象にして、(1) 英語接尾辞を持つ行名で replace_line_name_suffix が返す suffix を katakana_to_ipa の出力に正しく連結していること、(2) 「新幹線」等の例外ケースで期待する振る舞い(例: 接尾辞を結合しない/別扱い)が守られていることをそれぞれのケースで assert するテストケースを追加し、必要なテストデータは replace_line_name_suffix や katakana_to_ipa の戻り値を想定して構築してください。
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@stationapi/src/use_case/dto/line.rs`:
- Around line 11-15: name_ipa の新仕様(replace_line_name_suffix と katakana_to_ipa
を組み合わせて英語IPA接尾辞を連結し、Shinkansen 系の例外処理が正しく動くこと)を検証する DTO 層の単体テストを追加してください:
stationapi/src/use_case/dto/line.rs にある name_ipa 算出ロジックをテスト対象にして、(1) 英語接尾辞を持つ行名で
replace_line_name_suffix が返す suffix を katakana_to_ipa の出力に正しく連結していること、(2)
「新幹線」等の例外ケースで期待する振る舞い(例: 接尾辞を結合しない/別扱い)が守られていることをそれぞれのケースで assert
するテストケースを追加し、必要なテストデータは replace_line_name_suffix や katakana_to_ipa
の戻り値を想定して構築してください。
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: aeb5495c-378e-4d02-9a03-732e22256492
📒 Files selected for processing (2)
stationapi/src/domain/ipa.rsstationapi/src/use_case/dto/line.rs
This was referenced Mar 6, 2026
This was referenced Mar 15, 2026
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.
Summary
seibɯikebɯkɯɾo laɪnTest plan
replace_line_name_suffixのユニットテスト(セン→laɪn、ホンセン→meɪn laɪn、シセン→laɪn、シンカンセン保護、ライン等の非対象、空stem保護)🤖 Generated with Claude Code
Summary by CodeRabbit
リリースノート