Dictionary program in Ruby