Skip to content

元の英字キー列から大小文字の変換候補を追加する - #370

Closed
sinoda1114 wants to merge 2 commits into
azooKey:mainfrom
sinoda1114:codex/roman-case-candidates
Closed

元の英字キー列から大小文字の変換候補を追加する#370
sinoda1114 wants to merge 2 commits into
azooKey:mainfrom
sinoda1114:codex/roman-case-candidates

Conversation

@sinoda1114

@sinoda1114 sinoda1114 commented Sep 5, 2026

Copy link
Copy Markdown

日本語モードでfableと打ち「ふぁbぇ」と表示された状態から、fable・Fable・FABLEを選べるようにします。元のキー列を利用するため単語登録は不要です。

検証

複数のキー列・大小3種類・重複・候補選択と全文確定をテスト。

このブランチ単独で 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:48.272832Z 8201dd3 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: 8201dd3a25

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

requireEnglishPrediction: Config.DebugPredictiveTyping().value ? .manualMix : .disabled
)
)
let romanInput = self.composingText.input.map(\.piece).inputString(preferIntention: false)

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 Scope case candidates to the edited segment

When the user changes the conversion boundary with editSegment, candidates are expected to consume only the focused prefix so the unfocused suffix remains available. Reconstructing romanInput from the entire composingText instead makes every case candidate represent the whole composition (and line 583 gives it the whole input count), so selecting one after Shift-Left/Shift-Right consumes the suffix rather than converting only the edited segment. Build the candidate from prefixToCursorPosition() with the corresponding input count, as the existing selecting-mode Roman candidate path does.

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.

🟡 Changes recommended

追加候補の DicdataElement.ruby が元ローマ字入力ではなく convertTarget.toKatakana() になっており、候補の読み/学習データとして不整合になり得るためです。

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

Pull request overview

日本語モードのローマ字入力で、かな変換後の表示(例: ふぁbぇ)から元の英字キー列に基づく大小文字バリアント(lower/title/upper)を変換候補として追加し、単語登録なしで選択・確定できるようにする変更です。

Changes:

  • 変換候補生成後に、元入力ローマ字の大小文字バリアント候補を mainResults に差し込み
  • 大小文字バリアント生成ロジック(RomanCaseCandidates)を追加
  • 生成ロジックと SegmentsManager 経由での候補提示・全文確定をカバーするテストを追加
File summaries
File Description
Core/Tests/CoreTests/InputUtilsTests/RomanCaseCandidatesTests.swift 大小文字バリアント生成と、候補選択〜全文確定の統合テストを追加
Core/Sources/Core/InputUtils/SegmentsManager.swift 変換結果にローマ字大小文字候補を差し込む処理を追加
Core/Sources/Core/InputUtils/RomanCaseCandidates.swift 元入力ローマ字から lower/title/upper を生成するユーティリティを追加
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • 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 +583 to +586
composingCount: .inputCount(self.composingText.input.count),
lastMid: MIDData.一般.mid,
data: [.init(word: text, ruby: self.composingText.convertTarget.toKatakana(), cid: CIDData.固有名詞.cid, mid: MIDData.一般.mid, value: -18)],
isLearningTarget: false
@ensan-hcl

Copy link
Copy Markdown
Member

AzooKeyKanaKanjiConverterの側でやるのが適切な処理なのでそちらにお願いしたいです 🙏

@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