Skip to content

曜日の読みから直近の日付候補を追加する - #363

Closed
sinoda1114 wants to merge 3 commits into
azooKey:mainfrom
sinoda1114:feat/weekday-date-candidates
Closed

曜日の読みから直近の日付候補を追加する#363
sinoda1114 wants to merge 3 commits into
azooKey:mainfrom
sinoda1114:feat/weekday-date-candidates

Conversation

@sinoda1114

@sinoda1114 sinoda1114 commented Sep 5, 2026

Copy link
Copy Markdown

「げつよう」「げつようび」などを、今日を含む次の該当日の日付に変換できるようにします。今日から6日後までを対象とし、複数の日付書式を候補へ追加します。

検証

曜日の一致・7書式・タイムゾーン境界をテスト。

このブランチ単独で swift test --package-path Core --jobs 4 を実行し、Coreの77テストが成功しました。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:42.436117Z 1687b49 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 構築が走るため、通常入力時のパフォーマンス回帰が発生します。

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

Pull request overview

曜日の読み(「げつよう」「げつようび」など)から、今日を含む次の該当曜日の日付を複数書式で候補提示できるようにし、変換エンジン側の上位候補絞り込みで日付候補が欠落する問題を回避する変更です。Core の変換候補生成(SegmentsManager)に曜日由来の日付候補を補完するロジックを追加し、README とテストで仕様を明確化しています。

Changes:

  • 曜日読み→直近該当日(0〜6日後)の複数日付フォーマット候補を生成する DateShortcuts を追加
  • SegmentsManager で曜日読みの場合に日付候補を補完して候補リストへ挿入
  • README 追記 + 曜日一致/書式/カレンダー境界/DST/入力経路のテスト追加
File summaries
File Description
README.md 曜日読みから日付候補が出る仕様(範囲・例・タイムゾーン)を追記
Core/Tests/CoreTests/InputUtilsTests/DateShortcutsTests.swift 曜日変換の仕様と境界条件(DST/日付跨ぎ/入力経路)をテストで担保
Core/Sources/Core/InputUtils/SegmentsManager.swift 通常候補取得後に曜日由来の日付候補を補完して候補に挿入
Core/Sources/Core/InputUtils/DateShortcuts.swift 曜日読み→直近日付候補(複数フォーマット)の生成ロジックを実装
Review details
  • Files reviewed: 4/4 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 +572 to +588
// 曜日の日付候補を通常候補の後に補い、エンジンの上位候補の絞り込みによる欠落を防ぐ。
let weekdayShortcuts = DateShortcuts.weekdays(matching: composingText.convertTarget.toKatakana())
var seen = Set(result.mainResults.map(\.text))
let weekdayCandidates = weekdayShortcuts.compactMap { data -> Candidate? in
guard seen.insert(data.word).inserted else {
return nil
}
return Candidate(
text: data.word,
value: data.value(),
composingCount: .surfaceCount(composingText.convertTarget.count),
lastMid: data.mid,
data: [data],
isLearningTarget: false
)
}
result.mainResults.insert(contentsOf: weekdayCandidates, at: min(5, result.mainResults.count))
@ensan-hcl

Copy link
Copy Markdown
Member

このPRに統合してもらえませんか?
azooKey/AzooKeyKanaKanjiConverter#358

@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