Rss Categories

Random Sentence Generator

Reference Number: AA-01952 Views: 21513 0 Rating/ Voters

The Random Sentence Generator is a feature of the Grammar Editor that makes it easy to check grammar coverage. This means you can use the tool to see what sorts of words and phrases are allowed by your grammar and their corresponding semantic interpretations.

About the Random Sentence Generator

To access the Sentence Generator, load a grammar into the Grammar Editor. Then, from the top menu bar, click to Tools > Random Sentence Generator.

You can also access the Random Sentence Generator for any grammar by right-clicking it in the grammar list:

Once you have loaded the Sentence Generator, it automatically generates a list of sentences labeled Parse Strings, and a corresponding set of Semantic Interpretations:

The Parse Strings on the right represent valid inputs to your grammar, and the Semantic Interpretations on the left represent their corresponding semantic output (if any).

For viewing longer utterances or interpretations, you can resize the entire window and drag the separator between Parse Strings and Semantic Interpretations to resize the panes themselves.

Using the Random Sentence Generator

The purpose of the Sentence Generator is to get a sense of the sorts of inputs your grammar allows. A common mistake grammar developers make is to allow too many input sentences, many of which may be nonsense. By reviewing the randomly-generated Parse Strings, you can see if there are any sentences that should be not allowed.

You can generate more random sentences by clicking the Refresh List button. Complex grammars can benefit from more sentences being generated and analyzed than simple ones, just because the number of possible parses tends to be much larger, so a bigger sample should be examined.

You can select any sentence by clicking on it and then clicking the Parse Tree... button at the bottom of the window to switch to the Grammar Editor and parse the sentence, so you can see the full parse tree for that sentence. You can examine the parse tree to see the exact rules that are being matched by the sentence, so that you can pinpoint the exact rules which may need to be fixed.

The Copy Strings button copies the sentences and interpretations to the clipboard in a comma-separated format.