From: WJ Date: 2011-04-18T01:40:23+09:00 Subject: Re: hash of arrays David Sprague wrote: > I'm wrote this code to bin a list of words by word-length: > > dict = Hash.new([]) > > dict_file.each do |line| > line.chomp!() > dict[line.length] << line > end words = IO.read( "data2" ).strip.split( /\s+/ ) dict = words.group_by{|w| w.size}