paranormal-or-skeptic/tokenizer.py

12 lines
189 B
Python
Raw Normal View History

2020-04-02 15:45:53 +02:00
#!/usr/bin/python3
from nltk.tokenize import word_tokenize
import nltk
import re
import string
def tokenize(d):
d = re.sub(r'\\n',' ',d)
words = word_tokenize(d)
return words