cky parser
a parser builds the structure of a sentence from grammar rules. cky fills a chart from short spans to long ones: each cell lists what those words can be, built from two smaller cells. it is the same “can” problem as on the viterbi page, with a different tool: instead of the likeliest tags it keeps every reading the grammar allows.
try this
- “the fish can fish” has three parses. flip between the first two and find the cell where they split.
- under more, turn noun compounds off. “the fish can” stops being a noun, and the third parse goes with it.
- pick “the can rusts”. viterbi needed probabilities to make can a noun here; this grammar has only one reading, because no rule lets “the” stand before an aux.