Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Add frequency sort option #67

Open
g0tmi1k opened this issue Jul 26, 2020 · 1 comment
Open

[Feature Request] Add frequency sort option #67

g0tmi1k opened this issue Jul 26, 2020 · 1 comment

Comments

@g0tmi1k
Copy link
Contributor

g0tmi1k commented Jul 26, 2020

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 g0tmi1k changed the title [Feature Request] [Feature Request] Add frequency sort option Jul 26, 2020
@digininja
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants