Created
December 9, 2016 16:08
-
-
Save rrggrr/017ec737f8d080d8e84689547aba9b0c 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 cleanText(text): | |
exclude = [")","(",'.','-',':','"',"'",",","&","$",u'"',u"'",";",u"&","`","’"] | |
#dd = {ord(c):None for c in badchars} | |
#tx = text.translate(dd) | |
#tx = text.translate(string.punctuation) | |
#print(text) | |
text = ''.join(ch for ch in text if ch not in exclude) | |
text = str(text) | |
return text |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment