Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
keeleliin
word_cloud_est
Commits
30f4269e
Commit
30f4269e
authored
Feb 29, 2016
by
terrycojones
Browse files
Copy STOPWORDS and add to it, then pass it (instead of passing None).
parent
0869b1f2
Changes
2
Hide whitespace changes
Inline
Side-by-side
examples/a_new_hope.py
View file @
30f4269e
...
...
@@ -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"
)
...
...
examples/masked.py
View file @
30f4269e
...
...
@@ -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
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment