contents index next

5. Graphical User Interface

The Hdrug widget (ale1.png) contains the following sub-widgets (from top-to-bottom).

5.1. The MenuBar

The `compile prolog file' button lets you choose a Prolog file which will be compiled. The `reconsult prolog file' button behaves similarly but reconsults the file. The `source tk/tcl file' button can be used to source a Tcl/Tk file. The `halt' button halts the application (really!).

The `enlarge left canvas' and `enlarge right canvas' buttons adapt the relative size of the two canvases.

It is also possible to restart the application. This implies that the graphical environment is restarted, but the application files are not reconsulted. This is useful if you are adding/debugging parts of the graphical interface. Use `restart x' to restart. `quit x - keep prolog alive' allows you to stop the interface, but continue the Prolog session.

The option `compare parsers' allows you to parse a single test sentence for each of the active parsers.

Use the option `parser selection' to activate or de-active a particular parser.

generate lf. This option is the inverse of the parse option. Now you are prompted for a logical form, which is subsequently input to the current generator. Again, you can either specify a logical form `by hand' or select a pre-existing logical form. Note that there is (yet) no concept of a test-suite for logical forms.

generate object. This option takes the logical form from the object that you select, and generates from this logical form. Note that other information ofthis object is not taken into account in the generation process.

generator selection. Use this option to activate or de-activate a particular generator.

compare generators on lf. Generate from a given logical form for each of the active generators.

compare generators on object. Generate from the logical form of a given object for each of the active generators.

The test-suite menu contains a number of options in order to test the application for a (pre-defined) set of sentences. This set of sentences is defined in a file called {} in the application directory, and consists of a number of Prolog clauses for the predicate sentence/2, where the first argument is a unique identifier of that sentence, and the second argument is a list of atoms. Note that there is (yet) no concept of a test-suite for logical forms.

The following options are provided.

run test-suite. If this option is chosen then all sentences are parsed in turn, for each of the parsers that are `active'}. Use the `parser selection' option to select the parsers you want to include/exclude for the run.

run test-suite and view. This option behaves similar to the previous option, but in addition statistical information comparing the different parsers is shown in a separate TK widget. The statistical information is updated after a sentence has been parsed by all active parsers.

reload test-suite. Choosing this option reloads the test-suite. Note that it does not destroy existing test-results.

view test-results. This option contains a number of sub-options that allow you to view the test-results in various ways.

individual tk. Presents a graph in which the length of the sentence is plotted against the parse time, for each of the different parsers and sentences.

totals per #words tk. Similarly, but now averages per sentence length are used.

totals per #words latex. This produces an Xdvi window containing a table of the parse results, again averaged over sentence-length. Note that all :atex files are placed in a temporary directory, given by the environment variable $TMPDIR. If this variable is not set, the directory /tmp is used. The predicate latex:files/5 can be used to get the actual file names that are used.

totals per #readings latex. This produces a table of the parse results, averaged over the number of readings.

individual prolog. This simply gives a Prolog listing of the table_entry/6 predicate.

totals per #words prolog. Prolog output of the average cputimes per parser per #words. This is given as a list of terms t(Length,Time,Parser) with the obvious interpretation.

destroy test results. Removes the test-results, i.e. retracts all clauses of the table_entry/6 predicate.

Note that not all view options will produce results. Sometimes these options are only defined for particular inputs. For example, in the Tree Adjoining Grammar application there are parsers that build derivation trees, and there are parsers that build derived trees. Hdrug is not always able to tell in advance whether e.g. the Tree(dt) filter (for derivation trees) is defined for a particular object.

5.2. The ObjectBar

5.3. The ButtonBar

contents index next