The
Sentence Explorer
is a tool to explore the structure of the sentences
generated by the grammar. One of its most typical uses is to try to generate
a given sentence from the grammar.
When loaded with a grammar, the Sentence Explorer looks like this:
The view initially shows all the direct expansions obtained from the root rule of the grammar (the tool can also be used to explore the structure of a different rule). Each expansion is displayed on a separate line. Black font is used for words and blue bold typeface is used for rule references.
When a rule reference is selected, its direct expansions are computed and a new sentential
form is created for each expansion by replacing the rule reference by the computed expansion.
For instance, selecting the rule reference $apartmentNumber in the
fourth sentential form of the previous example yields:
A box is created below the selected rule reference, displaying
all the sentential forms obtained by
replacing $apartmentNumber by
its direct expansions. The words and rule references in the
direct expansions of the selected rule reference are shown in
purple.
If the $letter rule reference is selected in the seventh
sentential form, we obtain:
Clicking on an expanded rule reference (in purple) undoes its expansion. For example,
clicking of $apartmentNumber in the first sentential form
yields the original direct expansions of the root rule:
When an expansion still contains rule references to expand, the '»' symbol is displayed to the right. Clicking on it initializes the sentence generation tool with the expansion.
All sentences or sentence patterns are prefixed by the '»' symbol. Clicking on it pops up a contextual menu. The content of the menu is different whether it is associated with a complete sentence or a sentence pattern (i.e. a sentence containing rule references).
For a complete sentence, the following menu is opened:
The Debug item opens the Sentence Interpreter and initializes it with the sentence. The Add ING Sentence (resp. Add OOG Sentence) adds the sentence to the coverage testset of the grammar as an "In Grammar" sentence (resp. "Out of Grammar"). If the grammar coverage testset does not already exist, it is automatically created.
For a sentence pattern, the menu contains a single item:
Selecting the item adds the pattern to the list of start sentence patterns in the Sentence Generation tool.
Copyright © 2007,2008,2009,2010,2011 Nu Echo Inc.