Commit 30f4269e authored by terrycojones's avatar terrycojones

Copy STOPWORDS and add to it, then pass it (instead of passing None).

parent 0869b1f2
......@@ -34,7 +34,7 @@ text = text.replace("HAN", "Han")
text = text.replace("LUKE'S", "Luke")
# adding movie script specific stopwords
stopwords = STOPWORDS.copy()
stopwords = set(STOPWORDS)
stopwords.add("int")
stopwords.add("ext")
......
......@@ -22,8 +22,11 @@ text = open(path.join(d, 'alice.txt')).read()
# http://www.stencilry.org/stencils/movies/alice%20in%20wonderland/255fk.jpg
alice_mask = np.array(Image.open(path.join(d, "alice_mask.png")))
stopwords = set(STOPWORDS)
stopwords.add("said")
wc = WordCloud(background_color="white", max_words=2000, mask=alice_mask,
stopwords=STOPWORDS.add("said"))
stopwords=stopwords)
# generate word cloud
wc.generate(text)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment