name_ipa・ja-JP発音にピッチアクセント(下げ核)を付与#1535
Merged
Merged
Conversation
jpreprocess(naist-jdic同梱)でアクセント核を推定し、ja-JPの読み(name_ipa およびカタカナ由来のja-JP name_tts_segments)の核モーラ直前にIPA下げ核 マーカー ˈ を挿入する。漢字推定→カナ推定→補正辞書のハイブリッド。尾高・ 平板は孤立読みで区別できないため語末核は付与せず、1名称につき主たる語中核 1つのみを採用する。en-USセグメントとname_roman_ipaは不変。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jun 16, 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.
概要
駅名など固有名詞の ja-JP 発音 IPA にピッチアクセント(下げ核)を付与し、Azure AI Speech 等の汎用 TTS でアクセントが体系的に外れる問題(例: 練馬春日町)を改善します。
name_ipaとカタカナ由来の ja-JPname_tts_segments[].pronunciationに IPA 下げ核マーカーˈを核モーラ直前へ挿入します(alphabetはIpaのまま)。変更の種類
変更内容
jpreprocess0.15(OpenJTalk フロントエンドの Rust 実装、naist-jdic辞書同梱)を依存追加。domain/ipa.rsにピッチアクセント推定・付与を実装。JPREPROCESS: 辞書を遅延ロード(ロード失敗時はNoneでアクセント付与を安全にスキップ)。analyze_accent: フルコンテキストラベルを解析。(アクセント句インデックス, A1)の組でモーラ境界を判定し、A1 == 0(モーラ位置 == アクセント型)を下げ核として抽出。pitch_accent_nuclei: 補正辞書 → 漢字推定 → カナ推定 の優先順位。推定モーラ数が読みと一致しない場合は破棄してアクセントなしに倒す。accented_katakana_ipa: モーラ境界を追跡(phonemes_to_tagged_chars/insert_syllable_breaks_taggedを新設)し、核モーラ直前へˈを挿入。既存katakana_to_ipaの出力は不変のまま内部リファクタ。accent_override: 推定ミス補正用テーブル(カナ読みキー、issue 案B)。練馬春日町を登録。compute_ipa_cached/compute_line_ipa_cachedに渡すよう配線(station / line / train_type DTO・query.rs)。name_ipaとカタカナ由来 ja-JP セグメントのみ。en-USセグメントとname_roman_ipaは不変。ˈhaɕi/ 橋haɕiを再現)。accent_overrideで明示。AGENTS.mdの TTS メタデータ節にピッチアクセントの仕様を追記。テスト
cargo fmt --all -- --checkが通ることcargo clippy -- -D warningsが通ることcargo test(SQLX_OFFLINE=true)が通ることcargo test --lib -p stationapiは 331 passed(新規アクセントテスト含む)。例: 京都ˈkʲo.ɯto(頭高)、渋谷ɕibɯja(平板=マーカーなし)、練馬春日町neɾimakasɯˈgat͡ɕo.ɯ(補正辞書)。関連Issue
Closes #1534
スクリーンショット(任意)