Created
September 25, 2013 10:08
-
-
Save soobrosa/6697632 to your computer and use it in GitHub Desktop.
clean text (needs homogenize)
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 clean(sentence): | |
stopchars = ['.', ',', '?', '!', '"', '-'] | |
gain = [] | |
sentence = sentence.lower() | |
for char in stopchars: | |
sentence = sentence.replace(char,' ') | |
words = sentence.split(' ') | |
for word in words: | |
if word <> '': | |
gain.append(homogenize(word.decode('utf-8'))) | |
return gain |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment