![]() |
VOOZH | about |
NLTK tokenize.regexp() module, we are able to extract the tokens from string by using regular expression with RegexpTokenizer() method.
Syntax : tokenize.RegexpTokenizer()
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.
Output :
['I', 'love', 'Python']Example #2 :
['Geeks', 'for', 'Geeks']