VOOZH about

URL: https://www.geeksforgeeks.org/python/python-nltk-tokenize-regexp/

⇱ Python NLTK | tokenize.regexp() - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Python NLTK | tokenize.regexp()

Last Updated : 7 Jun, 2019
With the help of 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 :
Output :
['Geeks', 'for', 'Geeks']
Comment
Article Tags:
Article Tags: