Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. def word_fdist(inaug_list):
  2. BANG = []
  3. notwords = ['!','"','%','(',')',',',':',';','.','?']
  4. stopword = stopwords.words('english')
  5. for x in range(len(stopword)):
  6. encoded_stopword = stopword.encode(x)
  7. removeWords = notwords + stopword
  8.  
  9. for i in range(len(inaugural.sents())):
  10. for j in range(len(inaugural.words())):
  11. if j.lower() not in removeWords:
  12. BANG.append(j)
  13.  
  14. return (FreqDist(BANG))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement