Created
February 10, 2020 02:53
-
-
Save mhashizume/8a466070aefb7f9cd58fcf1c42714097 to your computer and use it in GitHub Desktop.
This file contains 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
def sanitize_text(): | |
total_text = [] | |
# Regex split to strip non-alphanumeric characters | |
for line in fileinput.input(): | |
line.casefold() | |
words = [x for x in re.split("\W",line) if x] | |
total_text += words | |
return total_text |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment