Message Boards Message Boards

Letter frequencies in WordList

Posted 8 years ago

Can't run it on the Wolfram cloud. It's beyond my pay grade:

BarChart[Characters[StringJoin[WordList[]]]]
POSTED BY: Jackreece Ejini
2 Replies

Thank you. Quite elegant. I appreciate.

POSTED BY: Jackreece Ejini

Hi,

you are actually quite close. The first thing is that you don't actually need to join the strings. I made the labelling a bit nicer.

BarChart[#[[All, 2]], ChartLabels -> #[[All, 1]]] &@Reverse@SortBy[Tally[Flatten[Characters /@ ToLowerCase[WordList[]]]], Last]

enter image description here

I have also sorted the letters with respect to their frequency. The code I suggest is not the shortest one but should be easy to understand.

Cheers,

M.

POSTED BY: Marco Thiel
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract