next up previous contents
Next: Earley algorithm Up: Chart Parsers Previous: Chart Parsers   Contents

CKY algorithm

The Cocke-Kasami-Younger (CKY) algorithm is a passive chart parser, meaning edges are only added to the chart once an entire right hand side of a rule has been matched.

Gradually increasing the length of the substring considered, the CKY algorithm scans the words of the sentence attempting to add edges to its chart. If a right hand side of a rule is matched (using the existing edges in the chart) then the new rule (edge) is added to the chart, providing it is not already present. To initialise the parser, all possible lexical edges for each of the input words are added to the chart.

The main advantage of this approach is that is has complexity \( n^{3} \) (\( n \) is the number of words in the sentence), due to the three loops required to iterate over the length of the string with all lengths of substring.

A drawback of this algorithm is that grammars have to be in Chomsky Normal Form, (binary branching), and although for every CFG there is an equivalent CNF grammar, the structure of the parse tree will be completely different, and is unlikely to represent the desired syntactic structure.


next up previous contents
Next: Earley algorithm Up: Chart Parsers Previous: Chart Parsers   Contents
Andrew P Coates (UG) 2002-07-17