Cocke–Younger–Kasami (CYK) algorithm: a parsing algorithm for context-free grammars