X hits on this document

Powerpoint document

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

137 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 views137
Page views137
Page last viewedFri Dec 09 21:57:05 UTC 2016
Pages47
Paragraphs392
Words1978

Comments