Creating a Grammar

The grammar of a project consists of phrase structure rules, the definition of any variables used to describe the phrase structure rules, the specification of lexical categories and a lexicon. Specifying a grammar allows the user to draw trees in the assisted draw mode as well as using the check tree operation.

The operations to maintain the grammar for a project can be found under the Grammar menu heading and include Set up Rules and Set up Lexicon.


Maintaining phrase structure rules

Phrase structure rules can be maintained by choosing Grammar|Set up Rules. This will open the Set up Rules dialog, which will allow the user to add, edit, and delete phrase structure rules. Changes to the rules will be automatically reflected on the Grammar Pane. The order that the rules are displayed in the grammar pane can also be set via this dialog.

Rule Set up

Adding rules

Rules are added to the grammar by pressing the Add button, which will open an Add Rule dialog prompting the user for the new rule.

The format for a rule consists of a head category followed by a "consists of" symbol (written as "->") followed by the elements that make up the head category. Optionality is specified with parenthesis ( ) around the optional elements. Repeated elements are indicated with a "+". Choices are indicated by surrounding the choices with curly brackets { } and separating each choice with a "|". Square brackets [ ] can be used for grouping if necessary.

Non-category specific rules can also be added by making use of variables. For example the X in the above XP -> XP conj XP rule where X can stand for any category N, V, A, P. This provides a convenient means for adding conjunction to the grammar, as in the above case, and for allowing the specification of X' theory.

It is also possible to add more than one rule with the same head category which also provides support for the specification of X' theory.

Editing rules

Rules are edited by selecting the rule and pressing the Edit button, which will open an Edit Rule dialog prompting the user for the changed rule.

Removing rules

Rules are removed by selecting the rule and pressing the Remove button, which will remove the rule from the grammar.

Ordering rules

Rules are ordered by selecting a rule and pressing either the move up or move down button.


Maintaining variables

Variables are used to allow for the specification of X' theory and to provide a convenient means for adding conjunction to the grammar. They allow the user to specify a rule which is non-category specific, such as X -> X conj X where X can stand for any category. For assisted draw and the check tree operation to run correctly, it is necessary for the user to indicate that X is, in fact, a variable and to specify which categories X can stand for.

Variables can be maintained by choosing Grammar|Set up Rules. This will open the Set up Rules dialog that will allow the user to add, edit, and delete variables. Changes to the variables will be automatically reflected on the Grammar Pane. The order that the variables are displayed in the grammar pane can also be set via this dialog.

Variable Set up

Adding variables

Variables are added to the grammar by pressing the Add button, which will open an Add Variable dialog prompting the user for the new variable definition.

The format for a variable definition consists of the variable followed by a "consists of" symbol (written as "->") followed by the possible categories that make up the variable. The possible categories are surrounded with curly brackets { } and each category is separated with a "|".

Editing variables

Variables are edited by selecting the variable and pressing the Edit button, which will open an Edit Variable dialog prompting the user for the changed variable definition.

Removing variables

Variables are removed by selecting the variable and pressing the Remove button, which will remove the variable from the grammar.

Ordering variables

Variables are ordered by selecting a variable and pressing either the move up or move down button.


Maintaining Lexical Categories

Lexical Categories are the categories that constitute the parts of speach (N, V, A, P, T, C etc...). For assisted draw and the check tree operation to run correctly, the program must know which categories are lexical categories. By default, the program will assume that any category listed in the phrase structure rules, that is not the head of a rule, is a lexical category (and, therefore, must be terminated with a word). However, if a rule is added in which a word-level category is the head, such as a conjunction rule (i.e. X -> X conj X or N -> N conj N), then the user must specify that these categories are lexical categories. If variables are used to represent the categories, then this can be done by entering the variable.

Lexical Categories can be maintained by choosing Grammar|Set up Rules. This will open the Set up Rules dialog that will allow the user to add, edit, and delete lexical categories.

Lexical Category Set up

Adding lexical categories

Lexical Categories are added to the grammar by pressing the Add button, which will open an Add Lexical Category dialog prompting the user for the new lexical category.

The format for a lexical category consists of the name of that category or a variable representing a number of categories.

Editing lexical categories

Lexical Categories are edited by selecting the lexical category and pressing the Edit button, which will open an Edit Lexical Category dialog prompting the user for the new category name.

Removing lexical categories

Lexical Categories are removed by selecting the lexical category and pressing the Remove button, which will remove the lexical category from the grammar.

Ordering variables

Lexical Categories are ordered by selecting a lexical category and pressing either the move up or move down button.


Maintaining the lexicon

The lexicon can be maintained by choosing Grammar|Set up Lexicon. This will open the Set up Lexicon dialog that will allow the user to add, edit, and delete lexicon entries. Changes to the lexicon will be automatically reflected on the Grammar Pane.

Lexicon Set up

Adding lexicon entries

Lexicon entries are added to the grammar by pressing the Add button, which will create a blank row in the table allowing the user to enter the new lexicon entry.

The possible categories are restricted to a drop down list consisting of categories, in the phrase structure rules, which are either not the head of any rule or have been specified as lexical categories.

It is also possible to add more than one entry with the same word but a different category.

Editing lexicon entries

Lexicon entries are edited directly in the table by changing the word and/or selecting a different category.

Removing lexicon entries

Lexicon entries are removed by selecting a row and pressing the Remove button, which will remove the entry from the lexicon.

Ordering lexicon entries

The order that the lexicon entries are displayed in the lexicon tab can be controlled by clicking on a particular column header to sort the entries based on this column. A repeated click on the same column header changes the sort order direction from ascending to descending and vice versa. The columns can also be resized by the user.