abbrev(words, pattern = nil)
Class Public methods
Given a set of strings, calculate the set of unambiguous abbreviations for
those strings, and return a hash where the keys are all the possible
abbreviations and the values are the full strings.
Thus, given words is âcarâ and âconeâ, the keys pointing to
âcarâ would be âcaâ and âcarâ, while those pointing to âconeâ would be
âcoâ, âconâ, and âconeâ.
require 'abbrev'
Abbrev.abbrev(['car', 'cone'])
#=> {"ca"=>"car", "con"=>"c