aboutsummaryrefslogtreecommitdiff
path: root/data.py
diff options
context:
space:
mode:
authorAnthony Wang2022-02-21 14:29:48 -0600
committerAnthony Wang2022-02-21 14:29:48 -0600
commitf0643a44614b68aae22b9d6d20f6d59e59509dbb (patch)
treef52ad29b56c228de4db2648c17299fb799893a42 /data.py
parentff086a4dda75a1c27982e2471de0cf2fc99a2f2d (diff)
Reformat data.py
Diffstat (limited to 'data.py')
-rw-r--r--data.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/data.py b/data.py
index 84393c5..eaf9e54 100644
--- a/data.py
+++ b/data.py
@@ -23,7 +23,8 @@ text = [unescape(sub(r'<[^>]*>', ' ', status[2])) for status in statuses]
# Extract all words from statuses
words = [word for message in text for word in message.split()]
# Remove URLs and special characters and convert to lowercase
-words = [sub(r'[^a-z0-9]', '', word.lower()) for word in words if word.find('://') == -1]
+words = [sub(r'[^a-z0-9]', '', word.lower())
+ for word in words if word.find('://') == -1]
# Remove empty strings
words = [word for word in words if word != '']