Assignment 1: Due on Tuesday January, 29 2008
Part 1
Tell me how many words you know (in your native language). As
discussed in class, let's count simple morphological variants
(dog, dogs) as single words.
Part 2
Write a python program that accepts a plain text newspaper article as
input, and prints the number of paragraphs, sentences, and
words contained in the article. As mentioned in class, you
should try to be sensibly modular in doing this homework. You may
want to reuse this code in future assignments.
Use
this file
as a development example for your code. Don't
try to fit your code too closely to this one example, instead try to
generalize (somewhat) from what you see here.
I'll post a test file for you to use when the assignment is due.
What to Turn In
For Part 1, I'd like a short hardcopy paper that contains your answer
and how you came up with it. This should include an explanation and
justification of any decisions you had to make or methods you used in
arriving at your answer.
For Part 2, email me your python code and your answers for both
the development file and the test file that I'll post.
When sending me your code, send it as a python attachment with your
last-name and the assignment as the filename as in "jones-assgn1.py".
Don't tar, zip, gzip, compress, uuencode, jar, stuffit or otherwise encode it. Just a plain-text *.py file please.
Don't place it in-line. Make sure it is an attachment.