Fix IPA generation for compound station names#1430
Merged
Conversation
Contributor
📝 WalkthroughウォークスルーIPA変換ロジックを更新し、「開業」(kaigan)の接尾辞で終わるトークンを処理する新しいヘルパー関数 変更内容
コードレビュー難易度🎯 2 (Simple) | ⏱️ ~12 分 関連する可能性のあるプルリクエスト
提案ラベル
ポエム
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Comment |
Contributor
There was a problem hiding this comment.
🧹 Nitpick comments (1)
stationapi/src/use_case/dto/station.rs (1)
66-134: テストヘルパーの冗長性について
create_test_stationは多数のNone引数を持ち、可読性がやや低下しています。将来的にテストケースが増える場合は、ビルダーパターンやデフォルト値を持つ構造体への移行を検討してください。現状では機能しており、この PR の範囲としては問題ありません。
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@stationapi/src/use_case/dto/station.rs` around lines 66 - 134, The helper function create_test_station currently calls Station::new with many positional None/default arguments making it hard to read and maintain; refactor by introducing a TestStationBuilder or implement Default for Station and use struct update syntax or builder methods in create_test_station to set only the relevant fields (e.g., name, name_katakana, name_roman, TransportType) while leaving other fields as defaults, and replace the long positional Station::new call with the clearer builder/Default-based construction to improve readability and future extensibility.
🤖 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/station.rs`:
- Around line 66-134: The helper function create_test_station currently calls
Station::new with many positional None/default arguments making it hard to read
and maintain; refactor by introducing a TestStationBuilder or implement Default
for Station and use struct update syntax or builder methods in
create_test_station to set only the relevant fields (e.g., name, name_katakana,
name_roman, TransportType) while leaving other fields as defaults, and replace
the long positional Station::new call with the clearer builder/Default-based
construction to improve readability and future extensibility.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 78752c32-5081-4d05-8991-c75c9d4613fa
📒 Files selected for processing (3)
stationapi/src/domain/ipa.rsstationapi/src/use_case/dto/station.rsstationapi/src/use_case/interactor/query.rs
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
kaiganbefore English word lookupstation_name_to_ipaso station DTOs fall back correctly when roman parsing failsInagekaiganand katakana fallback behaviorTesting
SQLX_OFFLINE=true cargo test --lib --package stationapi use_case::dto::station -- --nocaptureSQLX_OFFLINE=true cargo test --lib --package stationapi test_station_name_ipa_splits_compound_kaigan_suffix -- --nocapturecargo fmt --package stationapiSummary by CodeRabbit
リリースノート
新機能
改善
テスト