Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
keeleliin
word_cloud_est
Commits
20cb719e
Commit
20cb719e
authored
Dec 02, 2014
by
defacto133
Browse files
Fix test for unicode so that it works in both py2 and py3
parent
328a7faa
Changes
1
Hide whitespace changes
Inline
Side-by-side
wordcloud/wordcloud.py
View file @
20cb719e
...
...
@@ -7,6 +7,7 @@
from
random
import
Random
import
os
import
re
import
sys
import
numpy
as
np
from
operator
import
itemgetter
...
...
@@ -253,7 +254,8 @@ class WordCloud(object):
"""
d
=
{}
flags
=
re
.
UNICODE
if
type
(
text
)
is
str
else
0
flags
=
re
.
UNICODE
if
sys
.
version
<
'3'
and
\
type
(
text
)
is
unicode
else
0
for
word
in
re
.
findall
(
r
"\w[\w']*"
,
text
,
flags
=
flags
):
if
word
.
isdigit
():
continue
...
...
Write
Preview
Markdown
is supported
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