This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import nltk | |
from nltk.corpus import stopwords | |
from collections import Counter | |
word_list = [] | |
# Set up a quick lookup table for common words like "the" and "an" so they can be excluded | |
stops = set(stopwords.words('english')) | |
# For all 18 novels in the public domain book corpus, extract all their words |