feat(dictionary): add dictionary search, synonyms, and examples adapters#241
Open
vkop007 wants to merge 1 commit intojackwener:mainfrom
Open
feat(dictionary): add dictionary search, synonyms, and examples adapters#241vkop007 wants to merge 1 commit intojackwener:mainfrom
vkop007 wants to merge 1 commit intojackwener:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces the powerful new Dictionary adapter to OpenCLI. It leverages the completely free, public
api.dictionaryapi.devrobust JSON endpoint to bring a reliable spell checker, dictionary, and thesaurus straight into the developer terminal.Commands Added (
opencli dictionary):search- Get the phonetic pronunciation, part of speech, and primary definition of any word (e.g.,opencli dictionary search --word "serendipity").synonyms- Extract up to 5 related synonyms for a given word by scrubbing the entire JSON definitions tree.examples- Find real-world sentence usage examples for complex vocabulary (falls back elegantly if a word lacks examples).Implementation Note: The YAML dataset extraction mappings were custom-built using recursive ES6 IIFEs to safely traverse variable-depth JSON nodes. This guarantees 100% crash protection against unpredictable empty arrays in the Dictionary API.
Related issue: N/A
Type of Change
Checklist
opencli validate)READMEintegration and VitePress docs)Documentation (if adding/modifying an adapter)
docs/adapters/(docs/adapters/browser/dictionary.md)docs/adapters/index.mdtabledocs/.vitepress/config.mtsScreenshots / Output