The Phrase and Coverage units

Phrase

“Phrases” (technically, context-free grammar rules) make it possible to write large sets of alternatives in a compact way. For example, prompts in conversational lessons, like the ones immediately above, often involve using request phrases. Rather than constantly repeating a regular expression like

( could i have | could you give me | i would like | do you have )

it is possible to define a “phrase”, as follows:

Phrase
PhraseId $ask-for
Response could i have
Response could you give me
Response i would like
Response do you have
EndPhrase

After this, the expression $ask-for can be used to mean “any of the alternatives defined in the Phrase $ask-for”. Phrase names have to start with a dollar sign $.

Coverage

Phrases are particularly useful for defining incorrect responses; as we saw in the pronunciation course from Level 1, it can often be a good idea to let the system recognise incorrect replies and alert the student to the fact that they are doing something wrong. Since there are, in general, many more ways to answer incorrectly than correctly, it can be necessary to define quite large sets of possible responses.

The Coverage unit allows the course designer to specify a set of phrases which the system will be able to recognise; the convention is that all of them will be treated as incorrect responses to every prompt, unless they happen to duplicate responses explicitly marked as correct. So, for example in a lesson about dates, we might have the following Phrase and Coverage units:

Phrase
PhraseId $month
Response january
Response february
...
Response december
EndPhrase

Phrase
PhraseId $day-number
Response first
Response second
...
Response thirty-first
EndPhrase

Coverage
Response $month $day-number
Response the $day-number of $month
EndCoverage

Here, the Coverage unit defines all phrases like “March fifteenth” or “the twenty-second of April”.