0
我想知道如何将散列添加到散列 上,并在内部增加散列。在散列或符号上动态添加散列红宝石
words_to_scan.scan(/\w+|\?|\.|!|\,/).select do |aword|
if words_from_file.has_key?(aword.to_sym)
words_from_file[aword.to_sym]['pop'] += 1
else
words_from_file[aword.to_sym]['pop'] = 1
end
end
我试图每当关键是不发现像
words_from_file = {:the => {'pop' => 3, 'positions' => [1,6,10]}}