Generating a reply in English for the questioner is easier than coping with the question itself since we can invent a standard form of sentence. For answering questions about the route to a particular Underground station we shall define a procedure (given in the appendix to this chapter) which will output replies of the form
Travelling by Underground, take the ...Line to ...
then change and take the ...Line to ...
then change and take the ...Line to ...
So, for example, the route from Victoria to Charing Cross would be described as follows:
Travelling by Underground, take the Victoria Line to Green Park
then change and take the Jubilee Line to Charing Cross
The sentence divides naturally into fragments, each of which is defined by the name of a station at which the traveller gets off the train together with the name of the corresponding line. The fragments appear in the order in which the corresponding stations would be encountered during an actual journey, and this is the same order in which these stations are generated by the route procedure. In general, one way of conveying the order in which events occur is to order the occurrence of corresponding parts of a sentence.
The program constructs the output sentence by scanning the list of stations produced by route from the beginning to the end. For each station at which the traveller must get off the train a segment of output sentence is generated, by inserting the name of the line and the station into gaps in pre-defined lists of words.
Generating natural language is not usually so straightforward. The items needed to form the text may not be ordered in time, they may contain other types of knowledge, such as descriptions or hypotheses, they may be too detailed to be repeated in full, or they may already be known to the user and so could be omitted from the text. Having chosen the items to report, and an ordering for them, the program must then form a piece of text that is coherent and flowing, with the right level of formality and a consistent style.
To give you a flavour of the current state of natural language generation, here is part of the output from a program named TEXT (McKeown, 1985), which generates responses to questions about a military database. In this instance the user has asked for the definition of `aircraft carrier':
An aircraft carrier is a surface ship with a DISPLACEMENT between 78000 and 80800 and a LENGTH between 1039 and 1063. Aircraft carriers have a greater LENGTH than all other ships and a greater DISPLACEMENT than most other ships. Mine warfare ships, for example, have a DISPLACEMENT of 320 and a LENGTH of 144 ...
Though we shall not detail how TEXT works, you will appreciate that it goes well beyond the capabilities of our humble Automated Tourist Guide.