项目作者: mosegontar

项目描述 :
A Ruby wrapper for the Datamuse API
高级语言: Ruby
项目地址: git://github.com/mosegontar/rubymuse.git
创建时间: 2017-08-08T19:19:27Z
项目社区:https://github.com/mosegontar/rubymuse

开源协议:MIT License

下载


Rubymuse

Rubymuse is a tiny api wrapper for the Datamuse API.

Installation

Add this line to your application’s Gemfile:

  1. gem 'rubymuse'

And then execute:

  1. $ bundle

Or install it yourself as:

  1. $ gem install rubymuse

Usage

To construct queries, pass query parameters as keyword arguments to Datamuse::words.

  1. require('rubymuse')
  2. # Find words with a meaning similar to the word 'programming'
  3. Datamuse.words(ml: 'programming')
  4. # Find words with a meaning similiar to the word 'programming' and related to the topic 'television'
  5. Datamuse.words(ml: 'programming', topics: 'television')
  6. # Find words that rhyme with 'orange'
  7. Datamuse.words(rel_rhy: 'orange')
  8. # Find suggested words based on partial string 'prog'
  9. Datamuse.sug(s: 'prog')
  10. # Find suggested words in Spanish based on partial string 'prog'
  11. Datamuse.sug(s: 'prog', v: 'es')

See Datamuse API for full documentation on Datamuse’s query parameters and options.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/mosegontar/rubymuse.

License

The gem is available as open source under the terms of the MIT License.