Skip to content

Latest commit

 

History

History
17 lines (12 loc) · 914 Bytes

README.md

File metadata and controls

17 lines (12 loc) · 914 Bytes

A small Python script for checking if a word is part of CFG (Context-free Grammar) or not. This script is implementing CYK (Cocke–Younger–Kasami) algorithm.

At the time, I couldn't find any simple/understandable implementation of CYK algorithm that I liked. If you have any questions feel free to create an issue.

Note

Your language must be in Chomsky form.

Usage

It's really straight forward. Change productions and start_symbol variables to your specific case. Then, just run it. Enter any word and see if it is part of the grammer.

TODO

  • Include grammer from seperate JSON file in runtime
  • Convert any CFG to Chomsky form
  • Add some checks

Issues

Found a bug or better solution? Please report to the issue section.