Ling 571 - Deep Processing Techniques for NLP
Winter 2016
Homework #1: Due January 12, 2016: 11:45pm


Goals

Through this assignment you will:

Background

Please review the class slides and readings in the textbook on context-free grammars. Also, see Section 8.3 of the NLTK Book for examples of how to write grammars and configure the included parsers. We'll get to the later parts of that chapter soon.

Building a Grammar

Based on the text and class notes, create a set of context-free grammar rules that are adequate to analyze a small set of English natural language sentences.

Your grammar should be able to produce parses for all sentences in the files (as well as other similar ones in the English language). The grammar should capture the major clause type (S, etc.), the major phrase types (NP, VP, PP, etc.), the parts of speech (POS) (NN, VBZ), and any punctuation or special symbols. The phrase and POS types specified in the Jurafsky and Martin text (CH. 12 and inside front cover) provide a good basis for your grammar.

You may hard-code capitalization.

Parsing

Create a program to parse the test sentences based on your grammar and analyze the results. Specifically, your program should:

Programming

Create a program named hw1_parse.py to perform the parsing as described above invoked as:
hw1_parse.py <grammar_file> <test_sentence_file> <output_file>
where

Files

Please adhere to the naming conventions.

Test and Example Files

Submission files

Handing in your work

All homework should be handed in using the class CollectIt.