Comp 170 Lab 5 - Tech Support, October 15

The tech support system attempts to make plausible responses based on simple matching with the user input. Currently there are two levels: Your assignment is to add a third level between these two: after keywords, but before random responses. You are to look for "question words" that begin the user input, such as "who", "what", "where", "how", "why". Actually, you won't require that the word begin the sentence, but you are to find the first question word, and base the response on that. Thus, if the user types "why is it that I cannot find what to do", you are to choose the why response, in the hope that that will be a more accurate "match" than to what. Note that this requires you to use the ArrayList representation of user input rather than the HashSet, because you need to go through the user input in order. (The basic three-level structure would still work with HashSets; we just then can't guarantee we're matching the first keyword used.) You can find the ArrayList version here.

Steps (all changes are to the Responder class)

Here are the words, together with some possible responses. You are strongly encouraged to improve them. Many responses here are based on a rather hypothetical guess as to the actual question.

word response possible question
who To contact an individual, go to our home page and click on the "directory" button who is in charge of this mess?
what Please check the manual HOW-TO section for that. what is the best way to ...?
where have you tried looking in the manual or the help files? where can I find out how to ....
when We expect to release that feature Real Soon Now. When will the fix be available?
how try looking up your topic in the index, or in the "how-to" tutorial. how do I file a complaint?
why Perhaps you should reread the manual on that topic. why can't I get cut-and-paste to work?

The reason these keywords aren't included in the first keyword HashMap (the HashMap called responseMap that includes "bug" and "windows") is that they are substantially less precise; we would like to check for all of the first group of keywords before trying any of these "question" keywords.

Email me your completed project.