100 likes | 385 Views
Lecture 2 Python Regular Expression. CSCE 771 Natural Language Processing. Topics Overview Readings: Chapters 1,2. January 16, 2013. Overview. Last Time Lec01- slides 1-31, 49-51 NLTK install Today Python Regular Expresssions Lec01 slides 32- NLTK book
E N D
Lecture 2 Python Regular Expression CSCE 771 Natural Language Processing • Topics • Overview • Readings: Chapters 1,2 January 16, 2013
Overview • Last Time • Lec01- slides 1-31, 49-51 NLTK install • Today • Python Regular Expresssions Lec01 slides 32- • NLTK book • http://www.amazon.com/Natural-Language-Processing-Python-Steven/dp/0596516495/ref=cm_cr_pr_pb_t • Online - http://nltk.org/book/ • NLTK corpora http://nltk.org/nltk_data/
NLP in Python vs other Programming Languages (Preface) • import sys • for line in sys.stdin: • for word in line.split(): • if word.endswith('ing'): • print word • Perl • Prolog • Java • C, Lisp, ruby, haskell
The Python Tutorial • http://docs.python.org/2/tutorial/ • Python is: • Interpreted • Dynamically typed
Python Basic Data Types • Strings • Integers • Floats • Lists • Dictionaries
Lists • >>> a = ['spam', 'eggs', 100, 1234] • >>> a • ['spam', 'eggs', 100, 1234]