Skip to content

Instantly share code, notes, and snippets.

@octoparse
Created April 16, 2019 02:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save octoparse/9d9b2adf1ed36da8ee860ef916e49db4 to your computer and use it in GitHub Desktop.
Save octoparse/9d9b2adf1ed36da8ee860ef916e49db4 to your computer and use it in GitHub Desktop.
txt = f.read()
txt = re.sub('[,\.()":;!@#$%^&*\d]|\'s|\'', '', txt)
word_list = txt.replace('\n',' ').replace(' ',' ').lower().split(' ')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment