Project #1
Some text files come with extremely long sentences.
Create a program to
- read a text file with long sentences
- split each long sentence
- assume a maximum sentence length (80?, 74?, 70?, 64?)
- split each long sentences into several shorter sentences
- shorter sentences should no exceed the specified length
- do not split words - split on word boundaries
- no need to split short sentences
- output a new file with the shorter sentences
Project #2
Create and interactive program
- let the user select the maximum sentence length
(set limits?)
- let the user select the input file
- let the user select the output file
Project #3
Project #1 except set a minimum sentence length
for documents with short sentences.
Possible Text Files For Testing
Declaration of Independence
United States Constitution
other text file(s)
Things to Think About
1. how to distinguish words in a text file?
(separated/terminated by spaces, punctuation, EOS, EOF?)
2. paragraph breaks (blank line?)
3. What to do if an error occurs (sentence can not be split?)
(print error message? delete new file?)
4. collect statistics on sentence length?
Note:
- EOS - End of String
- EOF - End of file