Skip to content

Instantly share code, notes, and snippets.

@colomon
Last active December 17, 2015 13:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save colomon/5618809 to your computer and use it in GitHub Desktop.
Save colomon/5618809 to your computer and use it in GitHub Desktop.
my $word-count = bag $*IN.slurp.words;
my $total-words = [+] $word-count.values;
say .key ~ ": " ~ .value / $total-words * 100 ~ "%" for $word-count.pairs.sort(-*.value)[^10];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment