Skip to content

fix: IPA母音長音化ルールを削除しGoogle TTSの誤読を修正#1419

Merged
TinyKitten merged 4 commits intodevfrom
fix/remove-vowel-length-contraction
Mar 7, 2026
Merged

fix: IPA母音長音化ルールを削除しGoogle TTSの誤読を修正#1419
TinyKitten merged 4 commits intodevfrom
fix/remove-vowel-length-contraction

Conversation

@TinyKitten
Copy link
Member

@TinyKitten TinyKitten commented Mar 6, 2026

Summary

  • apply_vowel_length 関数(ei→eː, oɯ→oː, oo→oː)を削除
  • Google TTSが を英語の /eɪ/ と解釈し「名鉄(メイテツ)」が「まいてつ」と発音される問題を修正
  • カタカナの音素をそのまま出力し、Google TTSに生のIPA音素列を渡すようにした

Test plan

  • domain::ipa::tests 全52テスト通過確認済み
  • Google TTSで「名鉄」「京成」「東京」等の発音を確認

🤖 Generated with Claude Code

Summary by CodeRabbit

  • 変更
    • 駅名・路線名のIPA表記ルールを更新しました。連続する母音の間に明示的な区切り記号が入るようになり、従来の長母音結合表記が置き換わります(例:大阪、京都、東海道などの表記が変わります)。
  • テスト
    • IPA表記の期待値を新ルールに合わせて更新しました。

apply_vowel_length関数(ei→eː, oɯ→oː, oo→oː)を削除。
Google TTSがeːを英語の/eɪ/と解釈し「名鉄」が「まいてつ」と
発音される問題を修正。カタカナの音素をそのまま出力するようにした。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions bot added the fix 直した label Mar 6, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 6, 2026

📝 Walkthrough

Walkthrough

IPA変換パイプラインから母音長短縮処理を削除し、連続母音間にドットで音節境界を挿入する新処理(insert_syllable_breaks)を導入。公開APIは変わらず、テスト期待値を新出力に合わせて更新。

Changes

Cohort / File(s) Summary
IPA ドメイン変更
stationapi/src/domain/ipa.rs
apply_vowel_length を削除し、連続母音にドットを挿入する insert_syllable_breaks を導入。最終IPA生成で長母音収縮を行わず、出力に明示的な . が入るように変更。テスト向けの期待値が更新。
DTO テスト修正
stationapi/src/use_case/dto/line.rs
Line DTO 関連のユニットテスト期待値を更新(例: セイブイケブクロ線、トウカイドウ本線、トウホクシンカンセンなどの IPA 出力がドット区切りに変化)。

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 母音のあいだに点を置いて、
すっきり歩くIPAの道。
テスト直しつつぴょんと跳ねて、
コードは軽やか、心もふわり。
ぴょん! 🎋

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed プルリクエストのタイトルは、IPA母音長音化ルールの削除とGoogle TTSの誤読修正という主要な変更内容を明確に要約しており、変更セットの主な目的と一致しています。
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/remove-vowel-length-contraction

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
stationapi/src/domain/ipa.rs (1)

438-450: Google TTS 実機での回帰確認をこのPRで完了させたいです。

ケイセイメイテツ の文字列期待値は適切ですが、今回の目的は Google TTS の誤読修正なので、最低でも「名鉄」「京成」「東京」の実読み上げ確認結果(ログ/音声)をPRに添付しておくと安全です。

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@stationapi/src/domain/ipa.rs` around lines 438 - 450, Add Google TTS
verification artifacts for the corrected readings: run the ipa("メイテツ"),
ipa("ケイセイ"), and ipa("トウキョウ") through the actual Google TTS engine (using the
same voice/settings as production), save the resulting audio files and short
logs showing the spoken text and output URI/response, and attach those files to
the PR; reference the related test functions (ipa, test_meitetsu,
test_oshiage/test_keisei) in the PR description and include a brief note
indicating the command/parameters used for reproduction so reviewers can replay
the audio.
🤖 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/domain/ipa.rs`:
- Around line 438-450: Add Google TTS verification artifacts for the corrected
readings: run the ipa("メイテツ"), ipa("ケイセイ"), and ipa("トウキョウ") through the actual
Google TTS engine (using the same voice/settings as production), save the
resulting audio files and short logs showing the spoken text and output
URI/response, and attach those files to the PR; reference the related test
functions (ipa, test_meitetsu, test_oshiage/test_keisei) in the PR description
and include a brief note indicating the command/parameters used for reproduction
so reviewers can replay the audio.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1d1f52a4-0937-43b7-ab5c-548833814a4e

📥 Commits

Reviewing files that changed from the base of the PR and between 4de3289 and 7580597.

📒 Files selected for processing (2)
  • stationapi/src/domain/ipa.rs
  • stationapi/src/use_case/dto/line.rs

TinyKitten and others added 2 commits March 6, 2026 13:50
Google TTSが連続母音(ei, ou等)を英語の二重母音として解釈し
「西武」が「サイブ」と発音される問題を修正。
insert_syllable_breaks関数で母音間に「.」を挿入し、
各母音が独立した音節であることをTTSに伝える。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
セイー、コウー、オオー、ラーメン、カッジ、カッジュ、ニッキョウ
など架空の組み合わせのテストを削除。
ニッキョウのパターンはドッキョウダイガクマエのテストでカバー済み。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@TinyKitten
Copy link
Member Author

@coderabbitai resume

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 7, 2026

✅ Actions performed

Reviews resumed.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@stationapi/src/domain/ipa.rs`:
- Around line 353-364: The syllable-break inserter insert_syllable_breaks
currently resets the vowel state when it sees the long-vowel mark (e.g. 'ː' or
'ー'), causing a dot to be inserted before a vowel that follows a long mark;
modify the loop so that long-vowel characters are treated as transparent: push
the long mark into result but do not change prev_is_vowel (i.e. preserve the
previous vowel state) so a following vowel is not treated as a new-vowel
boundary, and add a regression test (e.g. input containing "eːa" / "エーアイ") to
assert no dot is inserted between the long mark and the following vowel; refer
to insert_syllable_breaks and the prev_is_vowel variable when locating the
change.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 142aa642-64a2-41e1-8f59-f54d9df92ad2

📥 Commits

Reviewing files that changed from the base of the PR and between 7580597 and 3b86968.

📒 Files selected for processing (2)
  • stationapi/src/domain/ipa.rs
  • stationapi/src/use_case/dto/line.rs
✅ Files skipped from review due to trivial changes (1)
  • stationapi/src/use_case/dto/line.rs

@TinyKitten
Copy link
Member Author

@coderabbitai 他に指摘がないならapproveしてください

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 7, 2026

@TinyKitten 他に指摘事項はありません。PRの変更内容(apply_vowel_length の削除と insert_syllable_breaks への置き換え)は技術的に適切であり、全52テストも通過していることを確認しました。承認します。


🧠 Learnings used
Learnt from: TinyKitten
Repo: TrainLCD/StationAPI PR: 0
File: :0-0
Timestamp: 2026-03-05T14:23:40.565Z
Learning: In the TrainLCD/StationAPI repository, the maintainer TinyKitten strongly prefers that ALL review issues be raised together in a single comprehensive review pass. Do NOT raise additional issues incrementally across multiple review rounds after the initial review (no "後出しジャンケン"). Ensure the first review is exhaustive and complete.
✅ Actions performed

Comments resolved and changes approved.

@TinyKitten TinyKitten merged commit fb3827e into dev Mar 7, 2026
10 checks passed
@TinyKitten TinyKitten deleted the fix/remove-vowel-length-contraction branch March 7, 2026 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix 直した

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant