Link Conjunctions
A Different Way to Handle Conjunctions in a Link Grammar.
by Gary J. Shannon
July 10, 2006
This is only a half-baked idea off the top of my head. It may or may not work in practise, and even if it does work, would require some non-trivial changes to the parsing algorithm. Conjunctions are difficult to handle with a Link Grammar. While playing around, by hand, with the Link Grammar concept I stumbled onto this idea for handling conjunctions. The illustrations below use "and", but I have a hunch that "if...then..." and "when...then..." types of structures could be just as easily handled in this way.
The basic idea is to group phrases together early in the parsing process and remove them from the sentence by replacing them with some name that represented the parsed phrase. Consider: John and Marsha ran away. Let nouns have BTA+ and ATA- links. Let "and" have BTA- and ATA+ links. (Before The And and After The And.) "John and Marsha" is grouped by BTA and ATA links giving:
+-BTA-+-ATA-+
| | |
John and Marsha
This group is then treated as a unit named thing1.n, which gives us the sentence: "thing1.np ran away.". This is parsed: (with the definition of "thing1" shown below it.
+---Ss--+-MVp-+
| | |
thing.1 ran away.
|
+-BTA-+-ATA-+
| | |
John and Marsha
The line connecting "thing1.n" to "John and Marsha" is not a link to "and", but a link
to the entire group of words "John and Marsha".
In a similar manner, noun phrases are grouped and those groups can then be joined with "and".
The big dog and the little cat ran away.
+----Ds----+
| +--A--+ is a group that can be named "thing1.np"
| | |
the big.a dog.n
+-----Ds-----+
| +---A---+ is a group that can be named "thing2.np"
| | |
the little.a cat.n
The sentence now reads "Thing1.np and thing2.np ran away." The two "things" are then joined by "and" giving:
thing3.np
|
+----BTA---+----ATA----+
| | |
thing1.np | thing2.np
| | | is a group that can be named "thing3.np"
+----Ds----+ | +-----Ds-----+
| +--A--+ | | +---A---+
| | | | | | |
the big.a dog.n and the little.a cat.n
The sentence now reads "thing3.np ran away." This is parsed as shown, with the definitions for each "thing" shown below it.
+-----------Ss----------+-MVp-+
| | |
thing3.np ran away.
|
+----BTA---+----ATA----+
| | |
thing1.np | thing2.np
| | |
+----Ds----+ | +-----Ds-----+
| +--A--+ | | +---A---+
| | | | | | |
the big.a dog.n and the little.a cat.n
Applying the same logic to verbs and verb phrases we can let a different version of "and" link them with "VBA" and "VAA" ("Verb Before And" and "Verb After And"): The big dog and the little cat jumped and quickly ran away. First the phrase "quickly ran away" is parsed, grouped as type ".vp", and named action1.vp:
|
action1.vp
|
+--Em--+-MVp-+
| | |
quickly ran.v away
Next it is joined with the other verb by the version of "and" that joins verbs and/or verb phrases. This group is named "action2.vp".
|
action2.vp
|
+-VBA--+----VFA----+
| | |
| | action1.vp
| | |
| | +--Em--+-MVp-+
| | | | |
jumped.v and quickly ran.v away
The sentence to be parsed now reads "thing3.np action2.vp" which is easily parsed, with the definitions for each grouping shown below the group.
+----------------S---------------+
| |
thing3.np action2.vp
| |
+----BTA---+----ATA----+ +-VBA--+----VFA----+
| | | | | |
thing1.np | thing2.np | | action1.vp
| | | | | |
+----Ds----+ | +-----Ds-----+ | | +--Em--+-MVp-+
| +--A--+ | | +---A---+ | | | | |
| | | | | | | | | | | |
the big.a dog.n and the little.a cat.n jumped.v and quickly ran.v away