Message Boards Message Boards

3 Replies
5 Total Likes
View groups...
Share this post:

Finding character name frequency in books using Mathematica?

Posted 2 years ago

Hello! How might I find out how often a character's name appears in a book compared to another character? For example, if I wanted to see how often the name "Daisy" appears in the Great Gatsby as compared to the name "Gatsby"? I have tried WordCount but that doesn't work so far. Thanks for any help!

POSTED BY: Matt Dooley
3 Replies

Take a look at this post: 400th anniversary of Shakespeare's death

I recommend searching this forum, documentation, Wolfram blogs and other sites. There is a lot of useful information already published.

POSTED BY: Vitaliy Kaurov

Start with StringPosition and work from there. Take a look at the first half of

where I did this with Lord of the Flies.

POSTED BY: Jon McLoone

Try WordCounts instead of WordCount. For instance, if myGatsby is the variable holding the text of the book as a string, then you could use


which produces an association whose keys are the words and whose values are their frequencies. In the copy I downloaded from Project Gutenberg Gatsby appears 199 times and Daisy 150 times.

POSTED BY: Chris McHarg
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract