X hits on this document

Powerpoint document

Python for NLP and the Natural Language Toolkit - page 5 / 47

153 views

0 shares

0 downloads

0 comments

5 / 47

Modules and Packages: import

The import command loads a module:

# Load the regular expression module

>>> import  re

To access the contents of a module, use dotted names:

#   Use the search method from the re module

>>> re.search(‘\w+’, str)

To list the contents of a module, use dir:

>>> dir(re)

[‘DOTALL’, ‘I’, ‘IGNORECASE’,…]

Document info
Document views153
Page views153
Page last viewedTue Jan 17 22:15:32 UTC 2017
Pages47
Paragraphs392
Words1978

Comments