Skip to content

ahmadshafique/CYK-Parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Releases

No releases published

Packages

No packages published

Languages