CeWL icon indicating copy to clipboard operation
CeWL copied to clipboard

[Feature Request] Add frequency sort option

Open g0tmi1k opened this issue 4 years ago • 1 comments

So there is:

-c, --count: Show the count for each word found.

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

g0tmi1k avatar Jul 26 '20 10:07 g0tmi1k

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

digininja avatar Jul 27 '20 10:07 digininja