Skip to content

半角長音符の優先設定と番号の半角区切り候補を追加する - #365

Closed
sinoda1114 wants to merge 2 commits into
azooKey:mainfrom
sinoda1114:codex/halfwidth-long-vowel-mark
Closed

半角長音符の優先設定と番号の半角区切り候補を追加する#365
sinoda1114 wants to merge 2 commits into
azooKey:mainfrom
sinoda1114:codex/halfwidth-long-vowel-mark

Conversation

@sinoda1114

@sinoda1114 sinoda1114 commented Sep 5, 2026

Copy link
Copy Markdown

単独の長音符を変換するときに半角「ー」を優先する設定を追加します。即確定はせず全角も選択できます。また、457ー0067など英数字と区切りだけの入力に457ー0067と457-0067を追加します。

検証

設定オン/オフ・語中の除外・番号候補の選択と全体確定をテスト。

このブランチ単独で swift test --package-path Core --jobs 4 を実行し、Coreの87テストが成功しました。git diff --check も成功しています。

変換範囲と処理負荷

番号候補がない入力では重複チェックを行わず、文節編集中は全入力向けの番号候補を追加しません。設定名の「ハイフン」は入力キーの呼称として維持し、対象文字が半角長音符 (U+FF70)であることをREADMEに明記しました。

Copilot AI lite review requested due to automatic review settings September 5, 2026 03:43
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-05T03:46:10.288228Z 90d0e85 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

候補更新のホットパスで不要なSet生成が常時発生しうる点と、設定ラベル/READMEの用語が実際の挙動(単独長音符)と齟齬になりうる点を修正したいです。

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

単独の長音符「ー」を変換する際に半角「ー」を優先候補として提示できる設定を追加し、あわせて英数字+区切り記号だけで構成される文字列(郵便番号・電話番号・ID等)に対して区切りの半角候補( / -)を追加する変更です。入力体験(候補提示・選択・確定)と設定UI、およびCoreのテストで機能を担保する位置づけになっています。

Changes:

  • 単独長音符のときに半角「ー」を優先候補にする設定(Config/UI/候補生成)を追加
  • 英数字+区切りのみの読み(例: 457ー0067)に 457ー0067 / 457-0067 の候補を追加
  • 上記の挙動を検証するCoreテスト群を追加
File summaries
File Description
README.md 新機能(単独長音符の半角優先・英数字コードの区切り候補)を説明として追記
Core/Tests/CoreTests/InputUtilsTests/SegmentsManagerLongVowelMarkTests.swift 単独長音符の候補提示・確定・キャンセル等のテストを追加
Core/Tests/CoreTests/InputUtilsTests/HyphenatedCodeConversionTests.swift 郵便番号/電話番号/コードの区切り候補が提示・選択できることを統合テスト
Core/Tests/CoreTests/InputUtilsTests/HyphenatedCodeCandidatesTests.swift 区切り候補生成ロジックの単体テストを追加
Core/Sources/Core/InputUtils/SegmentsManager.swift 変換候補生成に「単独長音符の優先候補」+「区切り候補」を挿入
Core/Sources/Core/InputUtils/HyphenatedCodeCandidates.swift 英数字+区切りのみの読みから区切り表記ゆれ候補を生成するロジックを追加
Core/Sources/Core/Configs/BoolConfigItem.swift 新しいBool設定 TypeHalfWidthLongVowelMark を追加
Core/Sources/ConverterServer/ConverterServer+Settings.swift 設定ディスクリプタの公開と更新処理に新設定を追加
azooKeyMac/Windows/ConfigWindow.swift macOS設定画面の「入力オプション」に新設定を追加
Review details
  • Files reviewed: 9/9 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +606 to +617
let codeVariants = HyphenatedCodeCandidates.variants(for: self.composingText.convertTarget)
let codeTexts = Set(result.mainResults.map(\.text))
let codeCandidates = codeVariants.filter { !codeTexts.contains($0) }.map { text in
Candidate(
text: text, value: -18,
composingCount: .surfaceCount(self.composingText.convertTarget.count),
lastMid: MIDData.一般.mid,
data: [.init(word: text, ruby: self.composingText.convertTarget, cid: CIDData.記号.cid, mid: MIDData.一般.mid, value: -18)],
isLearningTarget: false
)
}
result.mainResults.insert(contentsOf: codeCandidates, at: min(5, result.mainResults.count))
),
descriptor(
key: Config.TypeHalfWidthLongVowelMark.key,
title: "ハイフンは半角を入力",
Comment thread README.md
Comment on lines +56 to +60
### ハイフンを半角で入力

設定の「カスタマイズ」→「入力オプション」で「ハイフンは半角を入力」をオンにすると、
日本語入力で単独の長音符を変換したときに、半角の `ー` を第一候補として表示します。全角の `ー` も選べます。
例えばローマ字入力の `-` キーが対象です。キーを押した時点では確定せず、通常どおり未確定の文字列を変換して確定します。
@ensan-hcl

Copy link
Copy Markdown
Member

このようなspecificな設定を追加するのは避けたいのでクローズします

@ensan-hcl ensan-hcl closed this Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants