Implementation of the CYK parsing algorithm