CS 5761 - Introduction to Natural Language Processing

Programming Assignment 3 - Demo in Lab on Monday, Feb 25 at 4pm
(submit code via email to patw0006@d.umn.edu before lab)


To gain experience with spelling correction techniques and the generally useful and powerful idea of dynamic programming.


Implement a program to compute the minimum edit distance of two words. Assume the version of Levenshtein distance in which insertions and deletions each has a cost of 1, and substitutions have a cost of 2. (This is the algorithm presented in section 5.6 of the text.)

Your program should wait for the user to input two words. Then your program should output the minimum edit distance between these words. Your program should also display a table (similar to figure 5.6) that shows the intermediate computations that your program made. Please make sure this the table has a human-readable format (ie align columns, rows, etc).

Do not assume that the length of the two words are the same. Be able to handle the case where one word is longer than the other. Convert all alpha input to lower case.

Policies (from syllabus)

All programming assignments and your project will be demonstrated during designated lab sessions. You should also submit an electronic copy of your source code to the TA prior to the designated demo session. (His email address is patw0006@d.umn.edu.) There is no other way to submit your programming assignments or project. Failure to submit AND demo on time will result in a zero.

Any code you submit should be commented. I must be able to understand what your code does simply by reading the comments. This understanding should extend down to the details of your code. So do not simply describe the input and output, also include comments that describe your particular algorithm and coding techniques. Failure to comment to this degree will result in a zero.

All assignments and the project are to be done individually. You are required to write your own code. Unless otherwise specified, you must only turn in code that you personally wrote. The only possible exception to this is if I tell you to use a module that is available in a book or online archive. However, I will clearly indicate when this is permissible. Violations of this policy will result in severe grading penalties and/or failure in the class.