Skip to content

Latest commit

 

History

History
10 lines (9 loc) · 663 Bytes

README.md

File metadata and controls

10 lines (9 loc) · 663 Bytes

CYK-Algorithm

Accepts a text file containing grammar of a language (in Chomsky Normal Form) and uses CYK Algorithm to check whether a given string can be accepted by the language

To Run Code:

  1. Run Driver.java
  2. Enter name of text file when prompted (eg cnf_part1.txt). NOTE: The text file should be in the Project folder (ICSI409_HW2), in the same level as the src and bin folders.
  3. At the next prompt, enter string that you would like to check
  4. The program will print whether the string can be obtained or not.
  5. At the next prompt, enter "y" if you would like to continue testing more strings for the same CNF. Enter "n" to exit the program.