Skip to content

Instantly share code, notes, and snippets.

View mhashizume's full-sized avatar

Michael Hashizume mhashizume

View GitHub Profile
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