From: John Carter Date: 2005-10-07T05:55:33+09:00 Subject: Re: Ruby Golf on Lazy T9 Words. So having learnt from the other posts I get down to... a=Hash.new(['']) ARGF.read.upcase.scan(/\w+/){|m| z = m.tr( 'A-Z', '22233344455566677778889999').split('').sort.uniq.size i=a[z] if (j=i[0].size) < n = m.size a[z]=[m] elsif j == n i << m end } a.keys.sort.each{|k| puts "#{k}\n\t#{a[k].sort.uniq.join("\n\t")}\n"} 1 DEEDED 2 BLACKBALL BLACKJACK DEPRESSED DEPRESSES PREFERRED REDRESSED REDRESSES REPRESSED REPRESSES 3 SHEPHERDESSES 4 PRESUMPTUOUSNESS 5 TRANSUBSTANTIATION 6 CONTRADISTINCTIONS DISENFRANCHISEMENT DISPROPORTIONATING HYPERSENSITIVITIES MISINTERPRETATIONS MISREPRESENTATIONS 7 COUNTERREVOLUTIONARIES ELECTROENCEPHALOGRAPHS 8 COUNTERREVOLUTIONARY UNCHARACTERISTICALLY John Carter Phone : (64)(3) 358 6639 Tait Electronics Fax : (64)(3) 359 4632 PO Box 1645 Christchurch Email : john.carter@tait.co.nz New Zealand Carter's Clarification of Murphy's Law. "Things only ever go right so that they may go more spectacularly wrong later." From this principle, all of life and physics may be deduced.