Python NLTK | tokenize.regexp()
With the help of
NLTK tokenize.regexp() module, we are able to extract the tokens from string by using regular expression with
Return : Return array of tokens using regular expression
Example #1 :
In this example we are using
RegexpTokenizer() method to extract the stream of tokens with the help of regular expressions.
[‘I’, ‘love’, ‘Python’]
Example #2 :
[‘Geeks’, ‘for’, ‘Geeks’]
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course