Open g0tmi1k opened 4 years ago
it already does sort by frequency, the --count
just adds the count to the output:
1067 sorted_wordlist = word_hash.sort_by do |word, count|
1068 -count
1069 end
1070
1071 sorted_wordlist.each do |word, count|
1072 if show_count
1073 outfile_file.puts "#{word}, #{count.to_s}"
1074 else
1075 outfile_file.puts word
1076 end
1077 end
So there is:
Could this be expanded at all, so another option, would just sort the list by frequency? The words/phrases that appear the most, at the top, least/unique values at the end? (and without the count?)
I know this can be done easy afterwards, just would be 'nice' to have it in-built