In grammar.py, read_rules takes each line in the grammar file and populates the instance variables rhs_to_rules, lhs_to_rules, and start symbol. Using parse_rule, it separates the lhs, rhs, and ...
This project implements the Cocke-Kasami-Younger (CKY) algorithm. The CKY algorithm determines whether a given string can be generated by a context-free grammar (CFG) in Chomsky Normal Form (CNF).
Abstract: Low-latency solutions for syntactic parsing are needed if parsing is to become an integral part of user-facing natural language applications. Unfortunately, most state-of-the-art ...