Parsing using CKY algorithm