The basic idea is that you guess the answer, and the program compares your guess with the correct answer and coaches you toward the correct answer.

The key software module is called SegMat, which means Segment Match(ing/er). Given two strings of text, SegMat first finds the longest common string. For example, suppose the two given strings are these:

"Once upon a midnight dreary, while I pondered weak and weary."

"Once upon a time, when I was very weak and weary and scared."
The longest common string is " weak and weary" which contains 15 characters (including the leading space).

SegMat next removes that string from each of the original strings. If it occurs anywhere except the very beginning or very end of an original string, that string is now split into more than one piece. Here's the above example at this point now:

"Once upon a midnight dreary, while I pondered" (1) "."

"Once upon a time, when I was very" (1) " and scared."
Note that SegMat remembers (1) where it pulled out that longest segment. Next SegMat matches all the remaining pieces, finding the longest common segment between any piece of the first original string and any piece of the second original string. In this case, it finds "Once upon a " which contains 12 characters. Again this common segment is pulled out, leaving:

(2) "midnight dreary, while I pondered" (1) "."

(2) "time, when I was very" (1) " and scared."
Next it finds ", wh" which contains 4 characters, leaving:

(2) "midnight dreary" (3) "ile I pondered" (1) "."

(2) "time" (3) "en I was very" (1) " and scared."
Next it finds " I " and "red" which contain 3 characters each, leaving:

(2) "midnight dreary" (3) "ile" (4) "ponde" (5) "" (1) "."

(2) "time" (3) "en" (4) "was very" (1) " and sca" (5) "."
Finally it finds "ry" and "nd" which contain 2 characters each, leaving:

(2) "midnight drea" (6) "" (3) "ile" (4) "po" (7) "e" (5) "" (1) "."

(2) "time" (3) "en" (4) "was ve" (6) "" (1) " a" (7) " sca" (5) "."
Now SegMat is normally used to compare your guess as to the answer (to some riddle or other question) which you type in, against the correct answer known to the program. Accordingly, it doesn't look for single-letter matches because that would allow you to cheat by simply typing the alphabet over and over as your guess and having it find all the places where each letter of the alphabet happens to match. You can still cheat a little bit by typing all the common two-letter swquences repeatedly, but that's so much work you'd never do it, right?

So after SegMat secretly does all the matching of segments, longest-first, that I've shown you above, what does the coaching program then actually show you? First of all, it doesn't show you all the mistakes you made. That would be too discouraging and distracting. In fact it doesn't show you *any* of the non-matching parts of your guess. Rather it shows you only the parts you guessed correctly, and simply discards all your mistakes. (Don't you wish your parents and schoolteachers had treated you that way, praising you for all your successes, and not nagging you about the mistakes you make along the way??)

First the coach puts back in all the matching segments, like this:

"Once upon a " "midnight drea" "ry" "" ", wh" "ile" " I " "po" "nd" "e" "red" "" " weak and weary" "."

"Once upon a " "time" ", wh" "en" " I " "was ve" "ry" "" " weak and weary" " a" "nd" " sca" "red" "."
Then the coach deletes each non-matching segment, replacing it with a single question mark to indicate some additional work needed there. Note that even if there was no unmatched text between two matching segments, it still puts a question mark there to remind you to join those two pieces together. You have to decide, for each question mark, whether some additional text is needed there or the two adjoining pieces should fit directly together. Also, it always puts a question mark after the last matching segment, and again you must decide whether additional text is needed there or not.

"Once upon a " "?" "ry" "?" ", wh" "?" " I " "?" "nd" "?" "red" "?" " weak and weary" "?"

"Once upon a " "?" ", wh" "?" " I " "?" "ry" "?" " weak and weary" "?" "nd" "?" "red" "?"
Next the coach runs all those matching segments and single question marks together to make just two big strings, one where the matching parts are sequenced per the correct answer, and one where they are sequenced per your partly-correct guess:

"Once upon a ?ry?, wh? I ?nd?red? weak and weary?"

"Once upon a ?, wh? I ?ry? weak and weary?nd?red?"
Notice how those two strings have exactly the same matching segments, but the top one is in the correct sequence toward reaching your goal of the correct answer, while the bottom one is in the sequence obtained by matching correct pieces out of your guess. So which of those does the program actually show you? Well, if it showed your correct parts in the sequence you gave them, you'd then have to do a lot of moving stuff around to get the correct sequence, which is a really painful edit with mouse sweeping and clicking, where you are liable to make mistakes and get very tired and frustrated just doing the mechanics of the edit, much less trying to guess the correct sequence. To save you this pain, it shows you the matching segments rearranged into the correct sequence. So it's the topmost of those two lines that it shows you. Also, because this will be regular text you can further edit, it can't include any bold text, so it removes all the boldness you saw above. So now you can't tell the difference between a question mark that is actually part of the correct answer, and a question mark that indicates (possibly) missing text. But answers to riddles and short-answer questions hardly ever have any question marks, so this is not a problem. So what it gives you back now is this:

"Once upon a ?ry?, wh? I ?nd?red? weak and weary?"
So here's what it would look like on your screen. You see this question and space to fill in your answer:


Question: What's the first line of "The Raven" by Edgar Allen Poe?
Guess the answer:

So you fill in your guess like this:


Question: What's the first line of "The Raven" by Edgar Allen Poe?
Guess the answer:

Then after you press the Submit... button (don't do it here!! The Raven isn't one of the riddles in this demo, so this example wouldn't actually work!!), the matching segments rearranged would come back like this:


Question: What's the first line of "The Raven" by Edgar Allen Poe?
Guess the answer:

So that's what the original version of the coach would have done, if The Raven were in the demo.

The actual coach as now implemented has extra features:

Summary: You get only one class of fixups, but all the fixups within that class, within a single turn. Rearrangements are top priority, but if none of those then you get capitalization fixups (if checked), but if not that then you get one free letter from the initial segment.

Quirks, by example:
You type:


Question: Why did the chicken cross the road?
Guess the answer:

but the correct answer starts "To get to the" (without the word "across"). So when you submit that, the coach matches "To get " and "to" separately, with capitalization fixup on the first of them, and the coach now shows you


Question: Why did the chicken cross the road?
Guess the answer:

but note the first question mark doesn't need any more text, so you should delete that question mark like this:


Question: Why did the chicken cross the road?
Guess the answer:

But suppose you don't realize the first two segments should be immediately adjacent, so you just submitted what the coach gave you with the question mark still there. You get one more free letter from the start, but now that initial segment actually *overlaps* with the next segment after it:


Question: Why did the chicken cross the road?
Guess the answer:

At this point you should delete both the question mark and one of the two copies of the same 't'. If you fail again, and just press Submit, it'll take away the second copy of the overlapped letter, and give you the next letter after it as a free letter, causing a new overlap on that next letter, like this:


Question: Why did the chicken cross the road?
Guess the answer:

If you do this repeatedly, you'll see letters one by one pass from the right segment to the initial segment without actually helping you solve the riddle. Here's a live demo for you to deliberately make this mistake over and over to see what happens, and then never make this mistake again. Here's your chance to act as stupid as Dan Quayle, and not get in trouble for it. Press Submit over and over, and watch what happens:


Question: Why did the chicken cross the road?
Guess the answer:

Show debug info / Auto-fix-capitals

After you've practiced with that demo, so that you have a feel for how the short-answer coach works and how best you can use it effectively and without too much frustration, please send me e-mail asking for info about where to find the full SegMat demo with several different riddles for you to try guessing. (Or if you already were at that full demo and clicked on the link to this tutorial, then just click the BACK link on your browser to get back to the demo.)