vinci lexical transformations


ivi/vinci includes the capacity to define and apply lexical transformations to a lexicon. Lexical transformations take advantage of the fact that lexical entries have a specific format. Consider the following entries:

"fly"|V|vi, human.subj, move||#1|||||
"jump"|V|vi, human.subj, move||#1|||||
"flow"|V|vi, liquid.subj, move||#1|||||
"drip"|V|vi, liquid.subj, move||#1|||||
"shout"|V|vi, human.subj, vocalize||#1|||||
"talk"|V|vi, human.subj, vocalize||#1|||||
"lift"|V|vtd, animate.subj, physobj.objd, affect||#1|||||

Fields are terminated by a vertical bar. The first field is a string representing the lexical item, the second the part of speech, the third a list of attributes, the fourth -- empty here -- a frequency specification, and the fifth a morphology rule. Here, the rule #1 means that the contents of field 1 should be output.

Let us look at the attributes more closely. We can see that they define classes. Thus, all verbs but the last have the attribute 'vi', meaning that they are intransitive, taking only a subject, but no object. Among the set of intransitive verbs, some have the attribute 'move', others the attributes 'vocalize' or 'affect'. These all describe the nature of the action performed by the verb. And within the set of 'move' verbs, some take a human subject ('human.subj'), while others take an 'animate' or 'liquid' subject.

Attributes are defined in a separate file. For the example here, the following attribute file would suffice:

Vtype (vi, vtd)
Nounsem (human, animate, liquid, physobj)
Verbsem (move, vocalize, affect)
Case (subj, objd)

Suppose we want to produce derived nouns which designate the person who performs some action. In terms of form, we wish to add the suffix "-er" to a verb, as in "talk" ==> "talker". From the point of view of meaning, we want to limit input to those verbs having a human subject and which describe some action. And we want our output to be composed of nouns which have the trait 'human' and which provide in addition some indication of the fact that the noun is derived from a verb.

To do this, we define a lexical transformation rule like the following:

rule 1

?|V|vi, human.subj|?|#1|?|?|?|?|
[#1.1 + "er"]|N|human||$s|||bv:V/[#1];|["someone who " + #1 + "s"]|

Let us look at this rule more carefully. It begins with the keyword rule followed by a digit, and ends with a percent sign (%) which terminates it. The body of the rule is divided into a left-hand side (the first line here) which defines the subset of verbs which are needed, a right-hand side (the third line here) which specifies what should be done to obtain the output, and an operator (_makes_) which tells the system to use the left-hand side to produce the output on the right-hand side.

The left-hand side may be thought of as a lexical search pattern (henceforth, LSP) which, when applied to some lexicon, selects only those lexical items which match its specifications. Here, the ? in the first field and elsewhere is a wildcard which accepts any input, while the V in field 2 limits input to items which are verbs. The attributes in field 3 limit the set of chosen verbs to those which are both intransitive (vi) and which take a human subject (human.subj). Finally, field 5 specifies that the verb chosen must have #1 in its morphology. (Clearly, a verb which does not change tense is not useful; this is a pedagogical simplication.)

The right-hand side contains operators with varying formats:

Applying lexical transformations

Lexical transformations are specified in a lexical transformation file, which may contain any number of distinct transformation rules. To apply it, we begin by installing the appropriate files (attributes, terminals and lexicon). Then, in core 7, we enter:

LX <filename>

where <filename> stands for the appropriate file. This installs the lexical transformation file. Errors in lexical transformations are indicated in the body of core 7.

Next, we call the appropriate rule by typing:

RX <rulenumber>

If there are no errors, the system will output the appropriate transformed lexical entries, which should look like this:

 \r"talker"|N|human||$s|||bv:V/"talk";|"someone who talks"|
 \r"shouter"|N|human||$s|||bv:V/"shout";|"someone who shouts"|
 \r"jumper"|N|human||$s|||bv:V/"jump";|"someone who jumps"|
 \r"flyer"|N|human||$s|||bv:V/"fly";|"someone who flys"|

Using ivi's editing facilities, these lines may be saved as a separate lexicon and loaded in the usual fashion.

Note several things: first, although the number of produced forms is small here, it can be very large when the lexical transformation rule is applied to a larger lexicon. (The current limit on lexical items matching a specific terminal is about 25,000, although this is a constant which can be adjusted.) Note also the form bv:V/"talk" on the first line of output. This is a lexical pointer which identifies the verbal base of the derived noun and permits the noun to call the verb, as in an exercise where a learner must find the underlying verbs behind derived nouns. The attributes have also been changed so that when these lines are added to the lexicon, it will be possible to search for a noun with the attribute 'human'. A definition has also been added in the last field.

The created lexical entries also have the sequence \r at their start; this permits ivi to be used to edit them as records.

Using morphology rules in lexical transformations

The careful reader will have noticed an error in this output: "flys" should be "flies". We can fix this problem by using morphology rules. For details on how these work in ivi/Vinci, see the section of the manual on morphology.

So how can we avoid producing "flys", while still producing "jumps"? Let us begin by defining a morphology rule which produces a plural in "-ies":

rule y
  * : #1- + "ies";

Basically, this rule says that in all cases (*), the first field should have its last letter removed (#1-) and that the string "ies" should be added to it. So "fly" becomes "fl" then "flies". We can then replace the previous lexical transformation rule with one containing a pointer to the new morphology rule, as in:

rule 2
[#1.1 + "er"]|N|human||$s|||bv:V/[#1];|["someone who " + $y " "]|

Note that this rule limits input to verbs ending in y (using the LSP "*y") to avoid outputs like "jumies" from "jump". The result of the new rule is:

 \r"flyer"|N|human||$s|||bv:V/"fly";|"someone who flies"|

There is also another area where rules can help. Consider the following additional lexical inputs:

"run"|V|vi, human.subj, move||#1|||||
"plan"|V|vi, human.subj, affect||#1|||||
"moan"|V|vi, human.subj, vocalize||#1|||||
"hit"|V|vtd, animate.subj, physobj.objd, affect||#1|||||
"bait"|V|vtd, human.subj, human.objd, affect||#1|||||

With the appropriate right-hand side specifications, these can also produce derived nouns. Specifically, we want to obtain "hitter", "planner" and "runner". But there is a problem, because if we use the existing lexical transformation rule, we will also get "moanner" and "baitter". In other words, we want to limit the set of inputs.

The following morphology rule helps us achieve that:

rule er2

<0 = "*un"> : #1& + "er";
<0 = "*oan"> : #1 + "er";
<0 = "*an"> : #1& + "er";
<0 = "*ait"> : #1 + "er";
<0 = "*it"> : #1& + "er";
* : #1 + "er";

Note several features:

The result of applying this rule looks like this:

"baiter"|N|human||$s|||bv:V/"bait";|"someone who baits"|
"hitter"|N|human||$s|||bv:V/"hit";|"someone who hits"|
"moaner"|N|human||$s|||bv:V/"moan";|"someone who moans"|
"planner"|N|human||$s|||bv:V/"plan";|"someone who plans"|
"runner"|N|human||$s|||bv:V/"run";|"someone who runs"|

Let us now combine what we have learned about morphology rules to achieve a more elegant solution to the "flys" problem. Previously, we defined a separate rule. But now that we have seen how to use subrules, we can revise the rule as follows:

rule y2
  <0="*y"> : #1- + "ies";
  * : #1 + "s";

So, if a word ends in "y", the last letter is removed and "ies" is added. However, if this pattern is not matched, then "s" is added to the first field.

This new morphology rule can now be included in a lexical transformation rule, as in:

rule 4
[$er2]|N|human||$s|||bv:V/[#1];|["someone who " + $y2]|

When rule 4 is run against the expanded lexicon, the output looks like this:

"baiter"|N|human||$s|||bv:V/"bait";|"someone who baits"|
"hitter"|N|human||$s|||bv:V/"hit";|"someone who hits"|
"moaner"|N|human||$s|||bv:V/"moan";|"someone who moans"|
"planner"|N|human||$s|||bv:V/"plan";|"someone who plans"|
"runner"|N|human||$s|||bv:V/"run";|"someone who runs"|
"hitter"|N|human||$s|||bv:V/"hit";|"someone who hits"|
"talker"|N|human||$s|||bv:V/"talk";|"someone who talks"|
"shouter"|N|human||$s|||bv:V/"shout";|"someone who shouts"|
"dripper"|N|human||$s|||bv:V/"drip";|"someone who drips"|
"flower"|N|human||$s|||bv:V/"flow";|"someone who flows"|
"jumper"|N|human||$s|||bv:V/"jump";|"someone who jumps"|
"flyer"|N|human||$s|||bv:V/"fly";|"someone who flies"|

Simpler or more complex output

At one end of the spectrum, lexical transformation rules can be used simply to find all lexical entries which match some complex pattern. For example, let us assume we want to see all verbs where a human vocalizes. We can achieve this effect using a rule like:

rule 5

?|V|vi, human.subj, vocalize|?|#1|?|?|?|?|

whose output will look like this:


At the other end of the spectrum, several left-hand side elements may be combined within a single right-hand side. Consider for example the following compounds in English: "sample sorter", "rock breaker", "turnip cleaner". All require a transitive verb where some human affects some physical object. The product takes the form N V+er. We can express this using the following lexical transformation:

rule 6

?|V|vtd, human.subj, physobj.objd, affect|?|?|?|?|?|?|
[#1.2 + " " + #1.1 + "er"]|N|human||#1||["someone who " + #1.1 + "s " + #1.2 + "s"]|

If this rule is applied to a lexicon like:

"sort"|V|vtd, human.subj, physobj.objd, affect||#1||||
"break"|V|vtd, human.subj, physobj.objd, affect||#1||||
"clean"|V|vtd, human.subj, physobj.objd, affect||#1||||
"throw"|V|vtd, human.subj, physobj.objd, affect||#1||||
"turn"|V|vtd, human.subj, physobj.objd, affect||#1||||
"open"|V|vtd, human.subj, physobj.objd, affect||#1||||

then the product will be the 36 forms (6 V x 6 N) based on the input, or:

"desk opener"|N|human||#1||"someone who opens desks"|
"trunk opener"|N|human||#1||"someone who opens trunks"|
"brick opener"|N|human||#1||"someone who opens bricks"|
"sample opener"|N|human||#1||"someone who opens samples"|
"turnip opener"|N|human||#1||"someone who opens turnips"|
"rock opener"|N|human||#1||"someone who opens rocks"|
"desk turner"|N|human||#1||"someone who turns desks"|
"trunk turner"|N|human||#1||"someone who turns trunks"|
"brick turner"|N|human||#1||"someone who turns bricks"|
"sample turner"|N|human||#1||"someone who turns samples"|
"turnip turner"|N|human||#1||"someone who turns turnips"|
"rock turner"|N|human||#1||"someone who turns rocks"|
"desk thrower"|N|human||#1||"someone who throws desks"|

We have truncated the list for brevity, but the principle should be clear. Note that more than one _and_ may be used in the same rule to create even more complex patterns, and all the morphology features are still available. Remember also that we have simplified the morphology rules here for the sake of the exposition. It would often be the case that rules will change from nouns to verbs. Note also that in cases like this, where two large classes are combined, the number of outputs can be very large. Thus, if we combine all of 1000 nouns with all the 1000 verbs, the result will be 1,000,000 new lexical entries!

Shared attributes

There are cases where we would like different lexical transformation subrules to share some attribute. Let us return briefly to rule 6, which finds combinations 'physobj' nouns and verbs which affect some 'physobj'. We repeat the rule here:

rule 6

?|V|vtd, human.subj, physobj.objd, affect|?|?|?|?|?|?|
[#1.2 + " " + #1.1 + "er"]|N|human||#1||["someone who " + #1.1 + "s " + #1.2 + "s"]|

However, this rule misses a generality, in that a typical lexicon will include verbs which affect not just physical objects, but other things as well. Let us take the case of liquids. A typical lexicon might contain verbs like:

"drink"|V|vtd, human.subj, liquid.objd, affect||#1||||
"spill"|V|vtd, human.subj, liquid.objd, affect||#1||||
"pour"|V|vtd, human.subj, liquid.objd, affect||#1||||

and nouns for liquids like:


It would be useful to capture all cases where the various direct objects could be compared, one by one, with all possible noun types.

As it turns out, this is possible. Remember that in vinci syntax rules, it is possible to define variables which permit such sharing of attributes, as in:

ROOT = choose Ge: Gender;
        N[Ge] ADJ[Ge]

So also in lexical transformations, such sharing may be defined. The common value or values are defined inside parentheses at the head of the lexical transformation rule. Thus, given the attribute class:

Nounsem (human, animate, liquid, physobj)

we can write the following variant of rule 6:

rule 61

(Ns: Nounsem)

?|V|vtd, human.subj, Ns.objd, affect|?|?|?|?|?|?|
[#1.2 + " " + #1.1 + "er"]|N|human||#1||["someone who " + #1.1 + "s " + #1.2 + "s"]|

When applied to a lexicon containing verbs like "break", "pour", and nouns like "brick" and "water", it will generate combinations like:

"juice pourer"|N|human||#1||"someone who pours juices"|
"water pourer"|N|human||#1||"someone who pours waters"|
"drink pourer"|N|human||#1||"someone who pours drinks"|
"juice spiller"|N|human||#1||"someone who spills juices"|
"water spiller"|N|human||#1||"someone who spills waters"|
"drink spiller"|N|human||#1||"someone who spills drinks"|
"juice drinker"|N|human||#1||"someone who drinks juices"|
"water drinker"|N|human||#1||"someone who drinks waters"|
"drink drinker"|N|human||#1||"someone who drinks drinks"|

as well as the usual "rock breaker", "trunk opener", "turnip cleaner", as we obtained from rule 6. Applied to a larger lexicon, it also provides the opportunity to explore patterns across semantic types.

Exploring metaphor

In one view of metaphor, it is based on replacing the semantic constraints on some lexical item by others which are broader Thus, in French, the verb "arriver" originally meant reaching a shore ("rive") but now means reaching any destination. Conversely, "meat" (actually, "mete") originally designated food in general (think of the expression "meat and drink"), but now means the flesh of dead animals typically when eaten by humans.

Changes in technology often make use of metaphors. Thus, we can use the verb "kill" to describe the shutting down of a computer program. Another phenomenon is the application of verbs of human cognition or volition like "think", "want", "try", to non-human agents, as in "the saw doesn't want to cut straight", or "the program refuses to terminate".

We can capture patterns like this using lexical transformations, as the following rule shows, where the attributes 'wish' and 'machine' are assumed to exist in the grammar:

rule 8

?|V|human.subj, wish|?|#1|?|?|?|?|
[#1 + "_1"]|!2|machine.subj, wish|!4|!5|!6|!7|!8|!9|

Remember that the symbol ! followed by a digit copies the contents of the source lexical item's field to the target item. So we are simply repeating most of the fields from the source item, but adding an underscore and a digit to the copy of the lexical item. Or course, we might also have simply added 'machine.subj' to the existing lexical item, which would then have two distinct possibilities for its subject. Or we might have added lexical pointers to show that the two lexical items are related.