Skip to content

数字の区切り記号と中黒にピリオド・スラッシュ候補を追加する - #367

Closed
sinoda1114 wants to merge 2 commits into
azooKey:mainfrom
sinoda1114:codex/numeric-separator-candidates
Closed

数字の区切り記号と中黒にピリオド・スラッシュ候補を追加する#367
sinoda1114 wants to merge 2 commits into
azooKey:mainfrom
sinoda1114:codex/numeric-separator-candidates

Conversation

@sinoda1114

@sinoda1114 sinoda1114 commented Sep 5, 2026

Copy link
Copy Markdown

5。1→5.1、10・10→10/10、単独の・→/と/を候補へ追加します。数字の全角・半角に対応し、文章中の句点や中黒は対象外です。

検証

不正な区切り・文章の除外・元候補維持・重複・全体確定をテスト。

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

検証は各ブランチ単独で実施しています。並行実行時に既存の設定共有テストが一度失敗したため、単独再実行で成功を確認しました。

変換範囲と処理負荷

文節編集中は選択中の範囲だけから候補を作り、その範囲だけを確定します。残りの文字は未確定で保持します。候補が空の場合の重複チェックは省略します。

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:45:24.093096Z 560b292 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 560b2924f9

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +578 to +582
let separatorCandidates = NumericSeparatorCandidates.variants(for: self.composingText.convertTarget)
.filter { !separatorTexts.contains($0) }.map { text in
Candidate(
text: text, value: -18,
composingCount: .inputCount(self.composingText.input.count),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Restrict separator candidates to the active segment

After the user adjusts the conversion segment (for example, shrinking 10・10 to a prefix with Control-I), convertTarget still contains the entire composition while the converter's mainResults represent the edited prefix. This code nevertheless creates 10/10 from the whole target and gives it an input count covering the whole composition, so selecting it ignores the requested segment boundary and commits all remaining text. Derive the variant and composing count from the active conversion range, or suppress these synthetic candidates while segment editing is active.

Useful? React with 👍 / 👎.

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.

🟢 Approval recommended

追加ロジックが入力全体を厳密に数字のみへ限定しており、候補挿入も重複排除されていて新規テストで主要ケースが検証されています。

Pull request overview

入力中の数値区切り(「。」/「・」)および単独の中黒に対して、記号の別表記候補(「5。1→5.1」「10・10→10/10」「・→/・→/」)を候補として提示できるようにし、文中の句点/中黒などは対象外となるようフィルタリングする変更です。

Changes:

  • 数値区切り/単独中黒から候補表記を生成する NumericSeparatorCandidates を追加
  • SegmentsManager の変換候補に区切り記号候補を重複排除して挿入
  • 上記のユニットテスト+ SegmentsManager 経由の統合寄りテストを追加
File summaries
File Description
Core/Sources/Core/InputUtils/NumericSeparatorCandidates.swift 区切り記号の別表記候補生成(数字のみ・空グループ除外・全角数字正規化)を実装
Core/Sources/Core/InputUtils/SegmentsManager.swift requestCandidates の結果に対し、区切り記号候補を重複排除して上位に挿入
Core/Tests/CoreTests/InputUtilsTests/NumericSeparatorCandidatesTests.swift 変換ロジックの単体テストと、候補保持/全体確定の動作確認テストを追加
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Lite

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

@ensan-hcl

Copy link
Copy Markdown
Member

これはAzooKeyKanaKanjiConverterの側で検討したいので、そちらにPRいただけると 🙏

@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