170 likes | 269 Views
CSSE221: Software Dev. Honors Day 15. Announcements Pass in UML for Cars, Trucks, Trains Homework 5 late day? Pass in now Better to defer CSSE230 until Spring Exam 1 next class: if you qualify for extra time, talk to me later this class. How are the capsule demos and prep going?
E N D
CSSE221: Software Dev. Honors Day 15 • Announcements • Pass in UML for Cars, Trucks, Trains • Homework 5 late day? Pass in now • Better to defer CSSE230 until Spring • Exam 1 next class: if you qualify for extra time, talk to me later this class. • How are the capsule demos and prep going? • What’s working? • What do you plan to do differently next time? • Yesterday’s groups will get grade later this week.
This week: Markov • Monday: • Stacks and Queues • Sets, Maps, and PriorityQueues • Tuesday: • Some pros and cons of various data structures • Brief example of file I/O • Introduction to Markov, a cool statistical text program with lots of data structures • Thursday: • Exam 1
Demo • Wrap up of Sets, Maps, and PriQueues • By the way, which of the data structures that we discussed yesterday could be called an associative array?
Markov Teams Repos is csse221-200810-<usr1>-<usr2>. If solo, use your personal repos. bennetrn-beltonj1 fishmad-sullivja skilessa-speyerea crockeea-morrisps johnsoad-priestjs lundgrpb-smithny leveyjr-wentztj bennindp-mcginnda Find your partner
Simple File I/O • Key concepts: • File objects and exceptions: • new File(“fileName”) • Output: construct a PrintWriter from that file, and use it in place of System.out) • Input: construct a Scanner from that file and use it like you would getting keyboard input • Demo: SimpleFileIODemo
Use other techniques for reading binary files • Data is more compact than text • .read(), .write() methods • Maybe we’ll study later?
Input: a text file the skunk jumped over the stump the stump jumped over the skunk the skunk said the stump stunk and the stump said the skunk stunk Processing: Gather word pattern statistics Store them in an appropriate data structure Markov • Output: a text file with many of the same properties as the original file • Full-justified, of course
Input: a text file the skunk jumped over the stump the stump jumped over the skunk the skunk said the stump stunk and the stump said the skunk stunk Statistics: Markov
Input: a text file the skunk jumped over the stump the stump jumped over the skunk the skunk said the stump stunk and the stump said the skunk stunk Statistics: Markov
Input: a text file the skunk jumped over the stump the stump jumped over the skunk the skunk said the stump stunk and the stump said the skunk stunk Statistics: Markov
Input: a text file the skunk jumped over the stump the stump jumped over the skunk the skunk said the stump stunk and the stump said the skunk stunk Statistics (n=2): Markov
Input: a text file the skunk jumped over the stump the stump jumped over the skunk the skunk said the stump stunk and the stump said the skunk stunk Statistics (n=2): Markov
Input: a text file the skunk jumped over the stump the stump jumped over the skunk the skunk said the stump stunk and the stump said the skunk stunk Statistics (n=2): Markov
n=1: the skunk the skunk jumped over the skunk stunk the skunk stunk n=2: the skunk said the stump stunk and the stump jumped over the skunk jumped over the skunk stunk Note: it’s also possible to hit the max before you hit the last nonword. Output
For the prefixes? For the set of suffices? To relate them? Statistics (n=2): Data structures
Full Justification • Do this step LAST • Output needs to be full-justified. • Required to use lists (array and linked) to hold the output line and modify it before you print it