There are 4 sample problems below, labeled A, B, C, and D. All are about Earley parsing.
A. Explain what gave rise to S25, S26, and S27 for the parser chart in Figure 13.14. Note that the answer isn't just: The predicter put S25, S26, and S27 there. Why does the predictor put S25, S26, and S27 in the chart? What happens at previously created edges that leads to the creation of S25, S26, and S27? Don't be scared to look at the algorithm in Figure 13.13 to get your answer. Answer: S24 is the source of S25, S26, and S27. When S24 is created, it creates a goal of finding a Nom starting at 2. Then the Predictor looks in the grammar to find all the rules for building a Nominal. There are 3 rules. The predictor adds one edge starting and ending at 2 [2,2] for each way of building a Nominal. These are S25, S26, and S27.
B. For this next part, use the following grammar Start Cat: s Rules ===== np -> det nom np -> nom np -> np pp vp -> v vp -> v np s -> np vp s -> aux np vp pp -> p np nom -> n Lexicon ======= has aux have aux in p the det dog n park v park n dogs n walk v walk n Be an Earley parser. Parse the parse the NP part of:
Show the Earley parsing chart in the same format as is used in Figure 13.14. Assign names like S1, S2, ... to all the edges and show them. Organize the edges, as in Figure 13.13, according to what index they end at. You should try to generate the edges in the actual order that the Earley algorithm in Figure 13.13 creates them, but I won't grade that. I will deduct for missing or incorrect edges. (Incorrect means the algorithm wouldn't actually propose such an edge; not that edge does not get used in the final parse).
Here is the answer.
C Explain what gave rise to S23, S24, and S25 for the parser chart above. Note that the answer isn't just: The predicter put S23, S24, and S25 there. Why does the predictor put S23, S24, and S25 in the chart? What happens at previously created edges that leads to the creation of S23, S24, and S25? Answer: S21 is the source of S23, S24, and S25. When S21 is created, it creates a goal of finding an NP starting at 3. Then the Predictor looks in the grammar to find all the rules for building a NP. There are 3 rules. The predictor adds one edge starting and ending at 3 [3,3] for each way of building an NP. These are S23, S24, and S25. D Explain what gave rise to S22 for the parser chart above. Answer: S20 is one of the sources of S22. When S20 is created, it creates a complete VP edge from 2 to 3 [2,3] for the completer to check. The completer then looks for any edge ending at 2 that needs a VP. S14 [0,2] is such an edge. So the completer creates a new edge from 0 to 3 for a complete S, and S22 is that edge. |