This is a C++ implementation of CYK Algorithm.
CYK algorithm is a parsing algorithm for context free grammar. In order to apply CYK algorithm to a grammar, it must be in Chomsky Normal Form. It uses a dynamic programming algorithm O(n^3) to tell whether a string is in the language of a grammar.
Program requires two input files.
- First file defines alphabets, variables and production rules.
- Second file contains strings to check against this grammar.
Sample input file format is given which works perfectly.
However, this program is space(" ") and semicolon(";") insensitive. Moreover, ALPHABETS and VARIABLES section are also not necessary. It will work fine :) BUT "PRODUCTIONS:" tag is necessary. Otherwise, it will not show any results.
You can get in touch with me on my LinkedIn Profile:
You can also follow my GitHub Profile to stay updated about my latest projects:
If you liked the repo then please support it by giving it a star ⭐!
If you find any bug in the code or have any improvements in mind then feel free to generate a pull request.
Copyright (c) 2020, Ahmad Shafique