<< Prev | - Up - | Next >> |

Now that we know about active edges, the fundamental rule, and agendas, it's time to put all these ingredients together and look at a concrete chart parsing algorithm. The bottom-up algorithm we shall use is essentially the general algorithm just studied, but with the details filled in to make it work bottom-up. To understand it, let's go through it step by step using an example.

Suppose we want to analyze the sentence "Mia danced" using the following grammar.

First, we have to initialize the chart and the agenda (step 1 of the general algorithm). The chart initialization works exactly like for the *passive* chart parser. So, the initial chart for the sentence *Mia danced* looks like this:

The initial agenda looks like this:

1. | |

2. |

For all words of the input we have added passive edges saying of which category the they are and what is their position in the sentence. The edge , for instance, is a passive edge (the dot is at the very end) that says that there is a between positions 0 and 1. This edge was added because we have the rule in our grammar.

Now that the initialization process is out of the way, we get to step 2, the ``repeat'' part of our general algorithm. The first thing we do is to take the first arc of the agenda (step 2a). In our example that's . We then check whether it is aready recorded in the chart (step 2b). That's not the case, so we add it:

Next, we try to apply the fundamental rule to the new arc (step 2c). The fundamental rule lets us combine an active arc with a passive arc that is immediately to the right of the active one. Since the arc we are working with is passive, we have to find an active arc to the left of, or more precisely, we have to find an active arc that's ending in position 0. There is no such arc, so we cannot do anything here. We go on to step 2d.

The general algorithm tells us that we have to build new hypotheses in this step. Let's see what that means for the bottom-up case. In bottom-up parsing, we always build the parse tree from the bottom upwards, i.e., we combine already completed constituents to form bigger ones. Therefore, we only apply step 2d to passive arcs when working bottom-up; we only predict new constituents based on already completed ones.

In our example we are dealing with a passive arc at the moment (). The prediction of hypotheses then works as follows. We look for grammar rules such that the first symbol on the right hand side of these rules is the same as the left hand side of the arc (which in our case). is such a rule, for example. We then build active edges for all of these rules. These edges start in the same position as the arc we were looking at, end in exactly that same position, and have the dot right after the arrow. Like this: . This edges is the hypothesis that we might be able to build an starting in 0. To do so we still have to find a , also starting in 0. As we have already found a starting in 0, that's a sensible hypothesis to make. If there were more suitable rules, we would build an active edge for each of them.

Summing up, the instantiation of step 2d for a bottom-up strategy is as follows: If the arc is *passive* and has category as its left hand side, then look for grammar rules that has as the first symbol after the arrow. Build active edges starting and ending in the end point of the arc for all of these rules. The dot is right behind the arrow.

We add all new edges to the agenda and are now at the end of the first round through the repeat loop of step 2. The chart and agenda look as follows:

1. | |

2. |

The agenda is not empty, yet, so let's start the 2nd round. The first part of this should be clear: we simply place the top of the agenda, that is, the active edge , on the chart. To apply the fundamental rule (step 2c) we have to find a passive edge in the chart that starts in position 0 (the end point of the active edge). There is one; namely, . We can therefore build the edge (go back to Section 11.2 if you don't see how this works) and add it to the agenda. As step 2d only applies to passive edges we skip it. The current state of chart and agenda are:

1. | |

2. |

In the next round will be moved from the agenda to the chart. Step 2c doesn't produce any new edges, but in step 2d the active edges and will be added to the agenda. Chart and agenda then look as follows.

1. | |

2. | |

3. |

Next, we move from the agenda to the chart. Applying the fundamental rule in step 2c gives us the new edge .

1. | |

2. | |

3. |

is moved to the chart. No new edge can be built.

1. | |

2. |

is moved to the chart. The fundamental rule creates .

1. | |

2. |

is moved to the chart. No new edge is created.

1. |

is moved to the chart. Step 2d predicts .

1. |

is moved to the chart. The fundamental rule produces .

1. |

is moved to the chart. The fundamental rule produces and . Step 2d, although applicable as is a passive edge, produces no new rules.

1. | |

2. |

is moved to the chart. Neither step 2c nor step 2d produce any new rules.

1. |

is moved to the chart. Again, no new edges can be built.

The agenda is now empty, so we exit the repeat. This takes us to step 3. And yes, we do have a passive s node from the first to the last node, so we have succeeded in recognizing the sentence.

<< Prev | - Up - | Next >> |

Patrick Blackburn and Kristina Striegnitz

Version 1.2.4 (20020829)