For the current section, we will continue to use the
grail0.pl
grammar for the examples.
At the top of the lexicon window is a menu bar, below which is displayed a list of the words in the lexicon for this grammar. Directly below the list of words are three entry fields, one labeled Word where a new word to be added to the grammar can be inserted, one labeled Mode for use with the multimodal grammars we will treat in a later section and one labeled Formula where basic or predefined categories can be entered. The arrow next to the Formula entry field gives a list of the predefined atomic and complex categories for the grammar. There are only a few of them: iv for intransitive verb, n for noun, np for noun phrase, pp for prepositional phrase, s for sentence and tv for transitive verb.
At the bottom of the window is a toolbar containing graphic representations of the different connections. When editing a lexical entry these toolbar buttons will insert different connections into the lexical entry. There are three possible connections linking three nodes, the only type of connection we have seen so far, but two connections linking two nodes are provided as well (these unary branches are an extension which is treated in a later section). The final toolbar button is the undo button which undoes the previous insert.
Suppose we want to enter a new determiner "some" to the lexicon. We can do this by selecting the determiner "an" from the lexicon, which displays the graph shown on the right. In addition to the graph being displayed by Graphviz, the Word entry field now shows the word "an". Replace this word by "some" then select [Edit/Copy Entry] from the menu bar.
As a result of this operation, a fresh lexical entry, identical to the first except for its lexical leaf, is shown in the Graphviz window. In addition, the list of lexical entries now shows the new lexical entry.
If you made a mistake, or decide against adding this new graph to the lexicon, simply select [Edit/Delete Entry], which will erase the currently selected lexical entry.
Verify your new lexical entry by parsing a sentence like.
Some knight menaces Arthur.
Arthur considers Lancelot brave.
It is a bit like the lexical entry for "is" we have seen before in that is selects a noun modifier like "brave" to its right, but it differs in that it requires, in addition to the noun modifier, a noun phrase to its right.
We can create a new lexical graph by typing the word we want to assign
it to in the Word entry field followed by selecting
[Edit/New Entry] from the menu bar. After typing
"considers" and selecting [Edit/New Entry]
the Graphviz window should look as shown in the figure above on the left:
it looks like a simple lexical entry, as we have seen them before,
with the exception that the category is a star *
instead of a
basic category. The star represents a placeholder and is the
designated place where insertions will take place. In addition to the
star, the node is colored blue, since it is the active node of the
current, still unfinished lexical entry.
In order to understand the toolbar buttons, we have to take into
account that there are two ways to connect the hypothesis node 1 to a
connection: by making it either the leftmost or the rightmost
hypothesis of the connection. The two open connections in the toolbar
reflect this distinction by using an arrow pointing to the lexical
leaf. So the toolbar button would look for
its argument to the right, whereas the
toolbar button selects its argument to the left. Pressing the last
button produces the image shown in the middle of the figure
above. Now, we still have to furnish two unknowns for node 2 and node
3. Node two is inactive at the moment, as indicated by the black color
and the use of a dash
-
instead of the star, and will be
the subject argument when we are finished editing. For the moment,
however, we continue with the active node 3. This time, we are looking
for two arguments to the right, so we press the button twice; first we produce the figure shown
above on the right, followed by the figure shown on the left below.
Not that if you make an error, you can undo the last insert (either of
an atomic category or of a link) by
pushing the (undo) button.
The active node 5 does not require further expansion: this will be the
resulting sentence category. By selecting
s
from the menu
next to the Formula entry field, we finish the s
node and the active node becomes node 6, as shown in the figure above
on the right.
You may have noticed that the toolbar buttons have changed after this
operation, with the links changing in their up-down symmetric duals
and open and filled circles changing places. This is because the
active node, which has been a hypothesis up till now, has become a
conclusion and the arrows which used to be pointing up to the active
hypothesis now point down to the active conclusion. So ,
and
have been replaced
by
,
and
. It is this first possibility (the leftmost
toolbar button we need at the moment.
We are almost finished, the structure is correct, we just need to
replace the placeholder items one by one with the correct atomic
formula. We do this by selecting n
, n
,
np
and finally np
. The result is the lexical
entry shown below.
When the last placeholder is filled, Grail will automatically ask if
you want to store this entry in the lexicon. Verify your entry is
correct and if so, add it to the lexicon. If you notice an error,
select cancel to continue editing the lexical entry and undo your
errors with the undo button or start anew.
Exercise 1.4 Now, see if you can analyse the sentence.
Let's use these macro's to add the word "herself" to
the lexicon. It is a category which selects a transitive verb to its
left in order to produce an intransitive verb. We start again by
pressing the leftmost button . Now, the result category 3 is active. From the
pulldown menu select iv, since the result will be an
intransitive verb. The desired structure will attach to node 3
directly and the argument node 2 will become active. This time, select
tv from the pulldown menu. This will complete the lexical entry
and ask you to store it.
Exercise 1.5 Test if your new lexical entry works correctly by analysing the sentence.