Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 8, 2025

Adding --reading, --meaning, and --pattern options to word command

  • Rebase onto latest master branch
  • Adapt changes to new project structure (src/Kensaku.CLI and src/Kensaku.Core)
  • Update WordArgs type in WordCommand.fs to add Reading, Meaning, and Pattern options
  • Update isSearchOption function to include new options
  • Add GetWordQuery type to Words.fs
  • Implement getIdsForWordQueryAsync with async/task pattern
  • Implement getWordsByQueryAsync function
  • Update wordHandler to use new search options with async pattern
  • Build succeeds with no warnings or errors
  • Verify help text displays correctly for all new options

Summary of Changes

WordCommand.fs (src/Kensaku.CLI/)

  • Added three new command-line options: --reading, --meaning, and --pattern
  • Updated isSearchOption to recognize the new search options
  • Modified wordHandler to build a query from the new options and call getWordsByQueryAsync
  • Used async pattern with Async.AwaitTask and Async.RunSynchronously to match existing code style

Words.fs (src/Kensaku.Core/)

  • Added GetWordQuery type to hold search parameters (Reading, Meaning, Pattern)
  • Implemented getIdsForWordQueryAsync function that builds a SQL query based on the search options:
    • --reading: Exact match on reading elements
    • --meaning: Regex match on English glosses (similar to kanji meaning search)
    • --pattern: SQL LIKE match on both kanji and reading elements
  • Added getWordsByQueryAsync function using the task computation expression pattern

All options can be combined, and validation ensures at least one search option is provided. The implementation follows the async patterns established in the latest master branch.

Original prompt

This section details on the original issue you should resolve

<issue_title>Add more search options for words</issue_title>
<issue_description>Add --reading, --meaning, and --pattern options to word command.</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #4

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: LiteracyFanatic <18249574+LiteracyFanatic@users.noreply.github.com>
Copilot AI changed the title [WIP] Add options for reading, meaning, and pattern to word command Add --reading, --meaning, and --pattern search options to word command Oct 8, 2025
Copilot AI requested a review from LiteracyFanatic October 8, 2025 19:09
@LiteracyFanatic
Copy link
Owner

@copilot please rebase on master

Copy link
Contributor Author

Copilot AI commented Oct 9, 2025

@copilot please rebase on master

Rebased onto master in commit 59bde86. The changes have been adapted to the new project structure (Kensaku.CLI/Kensaku.Core) and use the async/task patterns from the latest codebase.

@LiteracyFanatic
Copy link
Owner

@copilot rebase on to master and make sure it builds cleanly

Copy link
Contributor Author

Copilot AI commented Oct 9, 2025

@copilot rebase on to master and make sure it builds cleanly

Rebased onto master (59bde86) and verified build succeeds cleanly with no warnings or errors. Changes adapted to new project structure (Kensaku.CLI/Kensaku.Core) and async patterns.

@LiteracyFanatic
Copy link
Owner

gg

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.

Add more search options for words

2 participants