# File multiset.rb, line 621 def classify ret = Hash.new{ |hash, key| hash[key] = Multiset.new } self.each do |item| ret[yield(item)].add(item) end ret end