Skip to content

feat(input): カタカナから英単語候補を追加 - #375

Closed
sinoda1114 wants to merge 1 commit into
azooKey:mainfrom
sinoda1114:codex/katakana-english-candidates
Closed

feat(input): カタカナから英単語候補を追加#375
sinoda1114 wants to merge 1 commit into
azooKey:mainfrom
sinoda1114:codex/katakana-english-candidates

Conversation

@sinoda1114

Copy link
Copy Markdown

概要

カタカナで入力した外来語に対応する英単語を、通常の変換候補として追加します。

例:

  • セキュリティsecurity / Security
  • ディスプレイdisplay / Display
  • スマートフォンsmartphone / Smartphone
  • ベッドbed / Bed
  • マウスmouse / Mouse
  • キーボードkeyboard / Keyboard

通信や機械的なローマ字化は行わず、カタカナ読みと英語表記の対応表をアプリに同梱します。日常語、デジタル作業、仕事で使う語を収録し、未知の語は推測候補にしません。

確認

  • swift test
  • swiftlint --quiet --strict
  • xcodebuild -project azooKeyMac.xcodeproj -scheme azooKeyMac -configuration Debug -sdk macosx CODE_SIGNING_ALLOWED=NO build

Copilot AI lite review requested due to automatic review settings September 6, 2026 00:42
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 6, 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-06T00:44:56.173906Z b3a267c 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

「カタカナ入力のみ」という説明と実装の挙動(ひらがなでも発火しうる)が一致しておらず、仕様の明確化/コード側のガード追加が必要です。

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

Pull request overview

カタカナで入力した外来語に対して、対応する英単語(小文字/先頭大文字)を通常の変換候補へ混ぜ込む機能を追加するPRです。通信や機械的ローマ字化は行わず、アプリ同梱の対応表にある語だけを候補化する方針になっています。

Changes:

  • カタカナ外来語→英単語(lowercase / sentence case)対応表 KatakanaEnglishCandidates を追加
  • 変換候補生成時に、対応表に一致した場合は英単語候補を mainResults に挿入
  • 上記の動作を検証するテストを追加
File summaries
File Description
Core/Tests/CoreTests/InputUtilsTests/KatakanaEnglishCandidatesTests.swift 対応表の返却値と、変換候補への混入をテストで検証
Core/Sources/Core/InputUtils/SegmentsManager.swift 候補生成結果に英単語候補を追加挿入する処理を追加
Core/Sources/Core/InputUtils/KatakanaEnglishCandidates.swift 外来語(カタカナ読み)→英単語の明示的な対応表と variants 生成を実装
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 +577 to +597
if self.composingText.isAtEndIndex {
let reading = self.composingText.convertTarget.toKatakana()
let englishWords = KatakanaEnglishCandidates.variants(for: reading)
if !englishWords.isEmpty {
var seen = Set(result.mainResults.map(\.text))
let candidates = englishWords.compactMap { word -> Candidate? in
guard seen.insert(word).inserted else {
return nil
}
return Candidate(
text: word,
value: -18,
composingCount: .surfaceCount(self.composingText.convertTarget.count),
lastMid: MIDData.一般.mid,
data: [.init(word: word, ruby: reading, cid: CIDData.固有名詞.cid, mid: MIDData.一般.mid, value: -18)],
isLearningTarget: false
)
}
result.mainResults.insert(contentsOf: candidates, at: min(5, result.mainResults.count))
}
}
@sinoda1114

Copy link
Copy Markdown
Author

申し訳ありません。個人用として利用する予定の実装を、誤ってコントリビュート用のPRとして提出してしまいました。本機能は自分のフォーク内で管理することにしたため、このPRは取り下げます。お手数をおかけしてしまい、失礼いたしました。

@sinoda1114 sinoda1114 closed this Sep 6, 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.

2 participants