Skip to content

Instantly share code, notes, and snippets.

@amundo
Created January 23, 2014 17:51
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 amundo/8583392 to your computer and use it in GitHub Desktop.
Save amundo/8583392 to your computer and use it in GitHub Desktop.
import nltk
from nltk.corpus import brown
pronouns = 'i me my us we he she it her his its they them their'.split()
news_text = brown.words(categories='news')
fdist = nltk.FreqDist([w.lower() for w in news_text])
# worst bar chart in human history
for p in pronouns:
print p, '\t', '*' * (fdist[p] / 20), fdist[p]
i ******** 179
me * 31
my ** 43
us 13
we ***** 107
he ******************************** 642
she *** 77
it *********************** 478
her ****** 121
his ********************* 428
its ******** 178
they ************* 267
them **** 96
their *********** 231
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment