Message Boards Message Boards

GROUPS:

Letter frequencies in WordList

Posted 3 years ago
2759 Views
|
2 Replies
|
1 Total Likes
|

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

BarChart[Characters[StringJoin[WordList[]]]]
2 Replies

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.

Thank you. Quite elegant. I appreciate.

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