Rubymuse is a tiny api wrapper for the Datamuse API.
Add this line to your application's Gemfile:
gem 'rubymuse'
And then execute:
$ bundle
Or install it yourself as:
$ gem install rubymuse
To construct queries, pass query parameters as keyword arguments to Datamuse::words
.
require('rubymuse')
# Find words with a meaning similar to the word 'programming'
Datamuse.words(ml: 'programming')
# Find words with a meaning similiar to the word 'programming' and related to the topic 'television'
Datamuse.words(ml: 'programming', topics: 'television')
# Find words that rhyme with 'orange'
Datamuse.words(rel_rhy: 'orange')
# Find suggested words based on partial string 'prog'
Datamuse.sug(s: 'prog')
# Find suggested words in Spanish based on partial string 'prog'
Datamuse.sug(s: 'prog', v: 'es')
See Datamuse API for full documentation on Datamuse's query parameters and options.
Bug reports and pull requests are welcome on GitHub at https://github.com/mosegontar/rubymuse.
The gem is available as open source under the terms of the MIT License.