Skip to content

Instantly share code, notes, and snippets.

@khozzy
Created November 2, 2017 14:17
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 khozzy/615859c00a9ed8bd0d87cf6c00130755 to your computer and use it in GitHub Desktop.
Save khozzy/615859c00a9ed8bd0d87cf6c00130755 to your computer and use it in GitHub Desktop.
from nltk.tokenize import RegexpTokenizer
snippet = snippet.lower()
tokens = RegexpTokenizer(r'\w+').tokenize(snippet)
untokenize(tokens)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment