Grammar Explorer -- example of use

Here we see a simple example of using the Grammar Explorer to find out about an area of the grammar.

Our first step is to select a probe sentence (or other grammatical unit) for which the grammar should provide a classification. Let us assume that we want to see how the grammar organizes the ways that English has of referring to types of temporal expressions, such as "on Monday", "in the afternoon", "last year", etc. For this, we begin with a sentence exhibiting one of the desired types of expressions, e.g.:
 

John ate a cake on Tuesday.

The first step is to make this sentence known to the Explorer, we can do this by entering a single `unit for coding' from the File menu option, i.e.,
 

This brings up a small dialogue box where the target probe sentence can be entered, terminated by a carriage return. After entering the sentence and clicking on accept, the new sentence appears in the top text window of the coder thus:
 
The particular details for each of the menu options and the information displayed is given in the respective parts of the documentation proper. Briefly, however, the buttons down the righthand side control which of the selection of units to be coded is currently being examined. The settings shown here indicate that we are looking at the first such unit (since we have only loaded one) while the lower "0/1" indicates that of the units currently loaded we have so far coded zero of them.

Naturally, we can also load texts for coding from files rather than individually by typing, but this is described in the detailed documentation proper.

We can now begin exploring the grammar.

To do this, we select Code from the menu bar.

When we do this, the Explorer begins traversing the large systemic grammar that it has loaded. Each system of choice that is reached causes a dialogue box to be brought up so that you can select the feature that applies for the unit being coded. The first such choice point is that of the Rank system, which determines the type of grammatical unit that we are coding. The dialogue box appears thus:
 

Here we can see that there are four options for this choice point: morphemes, words, groups-phrases, and clauses. We need to select one of these to continue coding, or abandon coding at this point by clicking anywhere on the blankspace in the window. Selecting the exit box (the box marked X in the top righthand corner) causes the choice we have selected to be accepted in the coding, and traversal proceeds to the next, more `delicate' systems of choice. Thus, if we here select `clauses' (since our probe sentence is a clause), we proceed to the following options:

 

Here again, we have presented the name of the system of choice that we are considering (the Clause-Class given within the boxed options) and the particular choices that that system makes. Note also that the selections we have made so far are shown in the lower lefthand pane of the Explorer window.

Now, there will be many options that the grammar presents which may be unfamiliar. For example, we may not know what the difference between a `clause' and a `clausette' is meant to represent. One way of trying to ascertain what is meant is to examine the examples that are provided for each feature. We can obtain these examples from a menu of options that is brought up by right clicking on the name of the system we are considering. Right clicking on Clause-Class brings up the following menu:
 

This menu allows us to investigate a variety of kinds of information about the current choice point, as well as some finer control of the questions that the Explorer puts to the user during generation. For now, we are only considering the possibility of examining examples, so we select the fourth option Show Examples and then click on the lower left area to accept this.

When showing examples, the Grammar Explorer attempts to find some prestored examples which use the features in question and which match the type of sentence which one is coding. It determines how closely examples match by looking at the features which have been selected during coding so far. Note, however, that not all features in the grammar have examples already prestored. This will change as further examples are collected and added to the standard release. The present example is one where we see a gap in the prestored examples, since the following window of examples appears:
 

Here there are plenty of examples for `clause', but none for `clausette'. In the example lists, the grammatical unit that exhibits the feature being illustrated is shown highlighted in colour. All the sentences picked out for clauses are therefore clauses in their entirety since all of them is coloured. The red brackets indicate the grammatical structure of the examples, which can be investigated further as we will see below.

We might guess from these examples that `clause' is a possible selection for our probe test sentence, but in case we did not, or in case we were in any case interested in seeing what `clausette' could be, all is not lost. We could, for example, simply select `clausette' as the option we want to consider and see where it takes us. The next set of options that this brings up already gives a clue as to what kind of area of the grammar we have moved into.
 

Note that there is no point in asking here again for examples, since any selection from this system of Moodless-Type necessarily entails a selection of `clausette' and so would have shown up when we asked for examples there. We might now guess that `clause' was definitely a better place for us to explore, but if we pick for illustration here, say, `exclamation', we can directly inspect what kind of grammatical unit this corresponds to. After making this selection, coding is complete since no more options are presented. When we reach this stage where a complete coding has been achieved for the example being coded, we can inspect the grammatical structure that corresponds to the complete set of features that were selected during traversal. To do this, we select Show Structure from the main menu bar of the Explorer. This brings up the following graph which shows the grammatical structure that the loaded grammar produces given our selection of the features: clauses, clausette, exclamation.
 
The target sentence that we are trying to recreate using the resources of the grammar is shown beneath for comparison. Now we can see what kind of grammatical unit a clausette corresponds to and can judge that it is not a very close representation of our target.

We can now consider the other information that is being presented in the main coding window.

First, quit the structure grapher by selecting the Quit Example Structure option in the graph's menu bar. The main Explorer window will now look like this:
 

We can see that we now have coded one out of the one units that have been loaded ("1/1" on the righthand upper column). More usefully, we can see the features that we selected to give our structure above in the lower lefthand pane: this is called the selection expression. To the right of this, we have a summary of the features that we have selected so far for all the units we have been coding: since we have only coded one unit, each of the features has been selected for 100% of the units coded.

We can now proceed with the proper coding of our target sentence. The most convenient way to do this is to proceed directly to the feature that we selected wrongly above: i.e., to redo our selection of `clausette'. Redoing the selection of a feature is one of the options that is provided by right clicking on the desired feature in the selection expression pane. The menu that is brought up looks as follows:
 

The second option allows us to go back and redo our selection of `clausette': thus clicking on this option, and then accepting (lower left), makes the Explorer redo our coding up to the point we wish to reconsider. We are then presented directly with the clause/clausette option we saw above, and can at this point make the more appropriate selection of clause. This takes us on to the system Clause-Ellipsis, where the option `full' is the most natural one to take. Following this, we are brought to:
 
which shows that, in general, any number of systems may be brought up simultaneously for consideration. All of the systems that are relevant at a given point (i.e., which have had their entry conditions satisfied), will be presented for selection. Any systems where a selection is not made will be re-presented until a selection is made or until coding is abandoned.

A considerable number of systems are concerned with ascertaining whether a particular situation obtains or not. These are typically binary systems with two choices, one of which is the negative option. The initial startup behaviour of the Explorer is to present these negative choices as the defaults: thus the minimal options are assumed. This can save considerable time during coding since you only have to explicitly consider the positive cases. A dramatic example of this is the following dialogue, which we reach after two more rounds of feature selections:
 

This is already at the point where temporal specifications are considered, but we can also see that 10 of the 11 options presented here have already been defaulted (this is shown by the options in question already being selected when the dialogue box is brought up). Most of these are appropriate for our test sentence, but one clearly is not: i.e,. Temporal-Location. We can check whether this is indeed the option we want by considering the examples again as described above. This time we obtain:
 
Here again, the general grammatical unit where a feature is relevant is highlighted in color. In addition, where the feature in question affects some particular part of structure (for example, the "Last year" of the first example shown), that part of structure is shown in bold coloured type. Thus, we can see not only which clauses have the feature `temporal-location' in their selection expressions, but also the particular subconstituents which are conditioned by that feature. Note that we can also inspect the grammatical structure of any constituent shown in the example sentences; moving the mouse over the examples will show which constituents are mouse sensitive. As usual,  right clicking on such a constituent brings up a menu of inspection possibilities. Two of the most frequently used of these are to inspect the grammatical structure and to inspect the selection expression (i.e., those features of the grammar that were responsible for that unit being produced). Selecting the former for the third example above gives the following structure.
 
 
 
This shows the highlighted `last year'  indeed, as would be expected, to be a Timelocative constituent. Selecting the show selection expression option for the third example as a whole produces the following list:
 
 
Where all of the features that were selected for that constituent (and hence all of the features that would need to be selected if that unit were to be created fully during coding) are shown; this of course includes `temporal-location' as marked towards the bottom of the list.

So, continuing with the example, we would probably want to select `temporal-location' in our coding and this leads us on to several distinct subtypes of temporal location as well as other choices from other areas of the grammar. Making these as appropriate for the example sentence leads, after coding is completed and no further options are presented, to the following structure (shown with the Show Structure menu bar option).
 

 
This structure shows the results of our coding. It shows us both the immediate functional constituents of the unit we have coded (the Actor, Finite, Goal and Timelocative constituents), and either an example word selection illustrating the constituent or the set of grammatical features preselected for the substructure of that constituent. Thus, the Actor constituent (consisting of a conflation of Actor, Agent, Topical, and Subject grammatical functions) is shown to be preselected to require realization involving the grammatical features `nominal-group' and `nominative'. Since the lexical item selected for the Process is purely illustrative, we can see that the structure of the clause does conform to the clause rank structure of our target sentence.

Note that it is here that we see some of the benefits being brought by the natural language generation technology underlying the Grammar Explorer. The input that we provided was restricted to the selection of grammatical features; the corresponding grammatical structure was then produced automatically on the basis of those features using the preloaded generation grammar. If we had directly marked in the constituents shown in the structure, there would be no way of checking whether that combination was in fact licensed by the grammatical description.Since the structure is generated automatically, it can only be a structure that the grammar supports. If that structure is not what is required, then we know that either the coding is incorrect, thereby providing an additional check on the choices that were made, or the grammar is incomplete with respect to target sentence. Both pieces of information are valuable in their own right.

To round off this example, we can consider a couple of alternative sources of information. There are a number of distinct kinds of temporal expression and so far we have not differentiated among them. One of the places where there is quite a decisive branching point in the grammar that we did not discuss above is the choice point represented by the system TEMPORAL-LOCATION-PHORICITY.

We can directly examine this system from the selection expression list that we are left with in the lower left pane of the Explorer window after coding. We do this by using the right click menu for these features that we saw above when we retracted a feature choice. The option following retraction is to Inspect feature's system. This brings up the system in question, along with any structural constraints that its features impose. In the present case, selecting this option brings up the following graph:
 

This is the standard KPML development environment view for single grammatical systems. We can see here that the two features of the system, `phoric-time'/`nonphoric-time', place different structural constraints on the functional constituent Timelocative. The former requires a temporal adverb, the latter the prepositional phrase we saw preselected above. Now we can also examine the contrastive examples of these features by selecting the Show contrastive examples option from the menu that is brought up by left clicking on the two dots to the left of the arrow in the middle of the system. This menu allows information about the system as a whole to be inspected (and, when the grammar development environment is being used, to be changed). The contrastive examples for this system are shown in the following window:
 
 
This shows that the realizations involving phoric times are expressions such as `Last week', while those involving nonphoric-time are expressions such as `in the fall'; again providing another way of understanding the difference that is explicitly represented in the realization statements that were shown in the graphical representaiton of the system above. If we select from the example window the particular Timelocative constituents and look at their grammatical substructure (by positioning the mouse over the corresponding constituents and selecting the graph structure option from the rightclick menu), we get the following two graphs:
 
 
 
This shows how the two constituents have quite different internal structure. We could then, of course, go on to examine the features that were responsible for producing these structures by examining the selection expressions of the top nodes, or by attempting to code them ourselves using the Explorer.

Finally, we might be interested in obtaining an overview of the kinds of temporal expressions that the grammar supports. And for this we can start examining larger sections of the grammar. Again starting from the features in the Explorer window selection expression list and the rightclick menu of options, we can ask to Graph from feature `temporal-location'. This brings up a larger scrollable network graph of the following form.
 

 
This shows all those clause rank systems that are relevant for temporal locations and their interconnectivity. Note that the precise graph that you get will depend on how the Modes and Flags of the grapher are set. You can experiment with these to produce the most appropriate graph: often what is required will differ depending on the exact purpose for which the graph is being made. All of the information shown in the graph is mouse sensitive in a variety of ways, which clicking will reveal. The precise options for graphing are as described in the KPML development environment documentation section on Graphing System Networks..