Skip to content

Latest commit

 

History

History
53 lines (30 loc) · 1.75 KB

README.md

File metadata and controls

53 lines (30 loc) · 1.75 KB

CYK Parser

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.


Usage 🔧

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.


Author 👋

You can get in touch with me on my LinkedIn Profile:

Ahmad Shafique

LinkedIn Link

You can also follow my GitHub Profile to stay updated about my latest projects: GitHub Follow

If you liked the repo then please support it by giving it a star ⭐!


Contributions Welcome ✨

forthebadge

If you find any bug in the code or have any improvements in mind then feel free to generate a pull request.


License 📄

MIT

Copyright (c) 2020, Ahmad Shafique