Project 2

Notes on Part B

Deadline Change: Electronically Wednesday, Feb. 5 (usual time); paperwork in class the next day.

These notes don't stand alone.  Refer back to the main Project 2 instructions for a base description of the project. In particular, those instructions described briefly the three oracle types to be added to Part B.  [New! Oracle Mall and OracleUtils (1/31).  View README before using.]

New specifications:

Clarifications

Examples

A "letter" is any of the letters a-z of the English alphabetic.  A "word" is a set of consecutive letters, preceded by whitespace or punctuation, and followed by whitespace or punctuation.  Nothing else is a word.  (Note that under this definition, a word cannot span more than one line.) In the following

R U aware, CSE142 and 143 is the funnest d*** course, on this plnet!

the words are:

R U aware and is  the  funnest  course on this plnet

Each of the following are two words:

O'Brien, helter-skelter, MyProject.java, base-10-Ethernet, Nick's

 

"P2Main.java" is one word ("java").

When matching a request string to the file, you should ignore any non-English letters in the request.  Case is not considered in making a match.  For example, the following three requests should give identical results:

   "July 4, 1776"   "  Jul Y 5 1976"   "1776, ju (1776)-ly"

 

The following line of a text file:

    "Someone took Oscar Peterson's last song"

will match any of these requests (and many others):

"STOP"  "top" "tops" 

Just as with the original Text Searcher, your program should stop when it finds the first (complete) match to the request.  The line number reported should be the line of the file where the match begins.  The text captured in the omen should include that line plus any following lines that are part of the match.  For example, given the following lines (with line numbers shown):

55 a b c d

56 e f g

57 h i j k

59 l m n o p

If the request is "DE", then the omen will contain 55 as the line number and the two matching lines, both of which the omen should report, are

a b c d

e f g     

h i j k

Further Hints, etc. on the main P2 page.