IPA辞書を拡充してローマ字駅名の未解決を61件から1件に削減 - #1626
Merged
Merged
Conversation
make ipa-audit が報告する未解決名 61 件 (lines 1 / stations 59 / train_types 1) を解消する。 - lookup_english_word_ipa に 60 語を追加する。英語・カタカナ外来語由来の語 (Disney / Resort / Bayside / Screen / Vogel など) と、romaji_to_katakana が解釈できない訓令式・非ヘボン式表記 (Sirokanedai / Tamati / Mitumatu / Hatchonawate / 3chōme など) の両方を対象とする。日本語読みの IPA は katakana_to_ipa() の出力に合わせ、長音のみ既存エントリと同じ ː 表記に畳んだ。 - 日本式ローマ字のサーカムフレックス長音 (â/î/û/ê/ô) をトークン文字として 受け付け、マクロンと同じ規則で母音列へ展開する。従来は区切り文字扱いのため "Kyûjômae" が "Ky" / "j" / "mae" に割れて読みが崩れていた。 - camelCase 分割で現れる "sea" を追加する。"DisneySea" が「セア」と誤読されて いたが、名前全体としては解決扱いのため監査に現れないケースだった。 CSV 全 12,094 名称の name_roman_ipa を変更前後で突き合わせ、差分 56 件が すべて意図した改善であることを確認済み。残る未解決 1 件は Kii-Hosoakwa で、 CSV 側の綴り誤り (正: Kii-Hosokawa) のため辞書では扱わない。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Px4SXdeBULB87KqD1TzKfy
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughローマ字トークン解析がサーカムフレックス付き母音に対応した。母音は長母音表記へ正規化される。英語IPA辞書に語彙を追加した。訓令式表記、長音、丁目、施設名、略語の変換テストを追加した。 Changesローマ字IPA解析
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
10 tasks
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.
概要
make ipa-auditが報告する未解決名 61 件(lines 1 / stations 59 / train_types 1)を解消するため、IPA 辞書を拡充する。あわせて、日本式ローマ字のサーカムフレックス長音がトークン区切りとして扱われ読みが崩れていた問題を修正する。変更の種類
変更内容
lookup_english_word_ipa()に 60 語を追加。Disney/Disneyland/Resort/Bayside/Portopia/Playpia/Screen/Socio/Vogel/ROYCE'/YRP/GRAN/St./Univ./Pref.Art/Pref.Sportsなど。romaji_to_katakana()が解釈できない訓令式・非ヘボン式表記:Sirokanedai/Tamati/Mitumatu/Hasirano/saidaizi/suzi/Hatchonawate/3chōme/Inuboh/Ohmisakiなど。katakana_to_ipa()の出力に合わせ、長音のみ既存エントリと同じː表記に畳んでいる。âîûêô)をis_name_token_char()のトークン文字に加え、normalize_name_char()でマクロンと同じ規則の母音列へ展開。従来は区切り文字扱いだったためKyûjômaeがKy/j/maeに割れて読みが崩れていた(該当は球場前・接岨峡温泉・奥大井湖上の 3 駅)。seaを追加。DisneySeaがromaji_to_katakana()で「セア」と読まれていたが、名前全体としては解決扱いになるため監査に現れないケースだった。監査結果の変化
変更後に残るトークン
disneysea/wespa/toyamatoyopet/saishuniryocenterは、監査ツール側のextract_tokens()が camelCase 分割を行わないことによる偽陽性で、名称としてはいずれも解決済み。検証
CSV 全 12,094 名称の
name_roman_ipaを変更前後で突き合わせ、差分は 56 件。すべて意図した改善であることを目視で確認した。対応しなかったもの
Hosokawaの綴り誤り(kとaの入れ替わり)と判断した。誤った綴りを辞書に登録するのは適切でないため、CSV 側の修正で対応すべきものとして残している。修正すればromaji_to_katakana()がそのまま解決する。ToyamaToyopet-Honsha-mae(現・トヨタモビリティ富山 Gスクエア五福前)やEhime Univ. Hospital(愛大医学部南口)は、ローマ字が解決するようになった結果、英語表記どおりの古い名称を読むようになる。英語表記と読みが一致する状態なので本 PR では変更していないが、CSV 側の更新が別途必要。テスト
domain::ipaに訓令式ローマ字・サーカムフレックス長音・oh長音・丁目表記・施設ブランド名・略記(St./Univ./Pref.Art)の 6 テストを追加。cargo fmt --all -- --checkが通ることcargo clippy -- -D warningsが通ることcargo test(SQLX_OFFLINE=true)が通ること関連Issue
スクリーンショット(任意)
Summary by CodeRabbit