Skip to content

Latest commit

 

History

History
23 lines (16 loc) · 805 Bytes

README.rdoc

File metadata and controls

23 lines (16 loc) · 805 Bytes

<img src=“https://codeclimate.com/github/kalenkov/rhymes.png” />

Rhymes

Rhymes looks up perfect and identical rhymes using precompiled version of the Carnegie Mellon Pronouncing Dictionary.

Installation

gem install rhymes

Usage

ruby > require 'rhymes'
=> true
ruby > Rhymes.rhyme('ruby')
=> ["BOOBY", "DUBHI", "DUBY", "HRUBY", "KUBY", "LOOBY", "LUBY", "NEWBY", "RUBEY", "RUBI", "RUBIE", "SCOOBY", "TRUBEY", "TRUBY"]

Class method will load dictionary on each call. Use instance method to front-load the expense

ruby > require 'rhymes'
=> true
ruby > rhymes = Rhymes.new; rhymes.rhyme('ruby')
=> ["BOOBY", "DUBHI", "DUBY", "HRUBY", "KUBY", "LOOBY", "LUBY", "NEWBY", "RUBEY", "RUBI", "RUBIE", "SCOOBY", "TRUBEY", "TRUBY"]