Skip to content

英語読みIPAのら行を l に置換し Azure 英語音声での t 化を修正#1549

Merged
TinyKitten merged 1 commit into
devfrom
claude/azure-tts-r-pronunciation-0tnc4f
Jun 26, 2026
Merged

英語読みIPAのら行を l に置換し Azure 英語音声での t 化を修正#1549
TinyKitten merged 1 commit into
devfrom
claude/azure-tts-r-pronunciation-0tnc4f

Conversation

@TinyKitten

@TinyKitten TinyKitten commented Jun 26, 2026

Copy link
Copy Markdown
Member

概要

英語音声(Azure Dragon HD 等)で読み上げる英語読みIPAトラックにおいて、ら行が t/d のように発音されてしまう不具合を修正します。例として Roppongi(六本木)が「とっぽんぎ」のように聞こえていました。

変更の種類

  • バグ修正
  • 新機能
  • データの修正・追加
  • リファクタリング
  • ドキュメント
  • CI/CD
  • その他

変更内容

  • 原因: 英語読みトラック(name_roman_ipa / name_tts_segments)でら行を日本語の弾き音 ɾ(alveolar tap)のまま出力していたため。ɾ は英語音声では "water /ˈwɔːɾɚ/" の t のようなフラップ /t//d/ として実現され、「ら行」が「た/だ/ち」に化けていた。
  • 対応: station_name_to_tts_segmentslateralize_ra_row を追加し、英語読みトラックに限って ら行 ɾ を側面接近音 l に置換(語頭・語中・語末すべて対象)。
    • 例: ロッポンギ ɾoppoŋgiloppoŋgiカサイリンカイ ɾiŋka.iliŋka.i
  • 日本語音声で読み上げる name_ipakatakana_to_ipa)は honest な ɾ のまま維持(将来 ja-JP 音声で読む場合に備える)。
  • 英単語の R は別記号 ɹ を使うため影響しない(例: zɪɹoʊ はそのまま)。
  • proto のスキーマ(型・フィールド構成・lang 割り当て)は変更なし。発音文字列の値のみの調整。
  • なお、この ɾl 置換は過去に 英語音声でら行が t 化するため英語読みIPAのら行を l に置換 #1546 で導入され IPA生成処理を #1531 (7bf7f17) 時点に戻す #1548 で一括リバートされていたものを、本不具合の再発に対して再適用したもの。

変更ファイル:

  • stationapi/src/domain/ipa.rs(置換ロジック追加+テスト追加・更新)
  • stationapi/src/use_case/dto/station.rs(既存テストの期待値更新)

テスト

  • cargo fmt --all -- --check が通ること
  • cargo clippy -- -D warnings が通ること
  • cargo testSQLX_OFFLINE=true)が通ること

補足: 本実行環境では proto(別リポジトリの git submodule)を取得できず、ビルドを伴う clippy / cargo test を実行できませんでした。代替として stationapi/src/domain/ipa.rsrustc --test で単体コンパイルし、IPA モジュールの全 62 テストが通ることを確認済みです(Roppongi の回帰テストを含む)。fmt はパス。clippy / 全 cargo test は CI での検証を想定しています。

関連Issue

スクリーンショット(任意)


Generated by Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • 英語読み由来の発音表記で、ɾl として出力されるようになりました。
    • 英語読みとカタカナ読みで発音の扱いを分け、カタカナ読み側の表記はこれまで通り維持されます。
    • いくつかの英語読みケースで、期待される発音表記が最新仕様に合わせて更新されました。

英語音声 (Azure Dragon HD 等) で読み上げる name_roman_ipa /
name_tts_segments トラックでは、ら行の弾き音 ɾ が英語のフラップ /t/・/d/
(water の t) として実現され「ら行」ではなく「た/だ/ち」に化ける。
そのため Roppongi (六本木) が「とっぽんぎ」のように聞こえていた。

station_name_to_tts_segments で英語読みトラックに限り ら行 ɾ を側面接近音 l に
置換する。日本語音声で読む name_ipa (katakana_to_ipa) は honest な ɾ のまま維持。
英単語の R は別記号 ɹ を使うため影響しない。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H2p6CysaHBtKysPhfMZJ7m
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3e87312a-0723-41d8-81ce-a83e7d742328

📥 Commits

Reviewing files that changed from the base of the PR and between 0d2a752 and 2477699.

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

📝 Walkthrough

Walkthrough

英語読みトラックの駅名 TTS 生成で、ɾl に置換する後処理を追加し、関連する期待値とテストを更新しています。カタカナ読み側の挙動は維持されています。

Changes

IPA 英語読みトラックの変換更新

Layer / File(s) Summary
英語読みトラックの後処理
stationapi/src/domain/ipa.rs
station_name_to_tts_segments が romanized 由来の tts_segmentslateralize_ra_row を適用し、pronunciation 内の ɾl に置換する。
期待値と分岐の検証
stationapi/src/domain/ipa.rs, stationapi/src/use_case/dto/station.rs
英語読み系の既存期待値を ɾl 後の IPA に更新し、新規テストで romanized トラックでは l 化され、katakana トラックでは ɾ が維持されることを確認する。

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • TrainLCD/StationAPI#1545: phonemes_to_raw_ipaɾl 処理を外す変更と、同じ IPA 変換領域への調整が重なります。
  • TrainLCD/StationAPI#1546: stationapi/src/domain/ipa.rs の英語読みトラック ɾl 変換と、関連テスト期待値更新が同じ範囲にあります。
  • TrainLCD/StationAPI#1548: 英語トラックの ɾl 後処理に関する変更で、同じ IPA 生成経路に関係します。

Suggested labels

fix

Poem

ぴょん、ɾl におひげを変えた
英語読みの駅名が さらさら ひかる
かな読みは そのまま ころんと ɾ
ぼくは耳をぴくり、音を聞いた
今日のホームは ちいさく うたう 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed 英語読みIPAのら行を l に置換して英語音声の発音崩れを直す主変更を、簡潔に正しく表しています。
Description check ✅ Passed テンプレートの主要項目(概要、変更の種類、変更内容、テスト)を満たしており、内容も変更点と整合しています。
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/azure-tts-r-pronunciation-0tnc4f

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.


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

@TinyKitten TinyKitten self-assigned this Jun 26, 2026
@TinyKitten TinyKitten merged commit dcf6249 into dev Jun 26, 2026
11 checks passed
@TinyKitten TinyKitten deleted the claude/azure-tts-r-pronunciation-0tnc4f branch June 26, 2026 04:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants