Linguist 278: Programming for linguists

Course TuTh 10:00-11:30 am, 460-334
Course email
Discussion https://piazza.com/stanford/fall2013/linguist278
InstructorChristopher Potts
Office hrsThu 11:30-12:30,
and by appointment
Office460-101


Plan Assignment Reading/Reference
Sep 24
  1. Strings, integers, floats, lists
  2. The basics of functions
  3. (Some) built-in functions
  1. Assignment 1 [due Oct 1]
  2. [solutions]
  1. str
  2. Numeric types
  3. Built-in functions
  4. Dive into Python §2
Sep 26
  1. In-class exercises [solutions]
  2. The basics of for loops
  1. list
  2. tuple
  3. set
  4. dict
  5. Dive into Python §3
Oct 1
  1. In-class exercises [solutions]
  2. Alice in Wonderland
  3. Google Books 1-gram sample
  4. Dicts, tuples, sets
  5. File handling
  6. Control statements and iterators
  1. Assignment 2 [due Oct 8]
  2. [solutions]
  1. Control flow tools
  2. Reading and writing files
Oct 3
Oct 8
  1. Regular expressions
  2. In-class exercises [solutions]
  3. Words lists
  1. Assignment 3 [due Oct 15]
  2. [solutions]
  1. re
  2. regular expression cheat sheet
  3. Mastering Regular Expressions §1
  4. Dive into Python §7
Oct 10
Oct 15
  1. In-class exercises [solutions]
  2. Advanced function definition
  3. File globs
  4. Iterators
  1. Assignment 4 [due Oct 22]
  2. [solutions]
  1. Dive into Python §2
  2. glob
  3. Notes on yield
Oct 17
  1. Built in iterators
  2. A first look at working with webpages
  3. Towards general-purpose corpus tokenization: corpuswc.zip
  1. range, xrange, enumerate, and others
  2. urllib2
Oct 22
  1. In-class exercises [solutions]
  2. Toy CSV file
  3. Toy JSON file
  4. CMU Pronouncing Dictionary
  5. Speed tests for incrementing count dictionaries
  6. Using libraries
  7. Installing external libraries
  8. Object persistence/storage
  9. Processing CSV
  10. Processing JSON
  1. Assignment 5 [due Oct 29]
  2. [solutions]
  1. string
  2. collections
  3. itertools
  4. datetime
  5. dateutil
  6. scipy.stats
  7. pickle
  8. yaml
  9. shelve
  10. csv
  11. json
Oct 24
Oct 29
  1. In-class exercises [solutions]
  2. Processing XML/HTML
  3. Toy HTML file
  1. Assignment 6 [due Nov 5]
  2. sentences_solved.zip
  3. aoa_solved.py
  4. existentials_solved.py
  1. BeautifulSoup
  2. urllib2: the missing manual
  3. Dive into Python §8-9
Oct 31
Nov 5
  1. Defining your own classes
  2. Our classes for the CMU Pronouncing dictionary
  1. Assignment 7 [due Nov 12]
  2. [solutions]
  1. Classes
  2. Dive into Python §5
Nov 7
Nov 12
  1. Using NLTK
  2. Parallelization
  3. lingstruc.py
  4. parallelcounts.py
  5. Some large POS-tagged data to test the parallel code
  1. Assignment 8 [due Nov 19]
  1. NLTK
  2. Parallel Python
Nov 14
Nov 19
  1. Visualization with matplotlib
  2. xy_plot.py
  3. CGI programming
  4. Request CGI access for your account
  5. adder CGI programs
  1. Assignment 9 [due Dec 3]
  1. matplotlib
Nov 21
  1. Using databases
  1. MongoDB
Thanksgiving recess
Dec 3
  1. Using Stanford's computing resources
  2. Template for a CGI program that obfuscates email addresses
  1. Final project [due Dec 12, 6:30 pm]
  1. Stanford IT site
Dec 5

[Stanford F13 academic calendar]