Skip to content

Cocke–Younger–Kasami algorithm written in Python

Notifications You must be signed in to change notification settings

TimHi/CYK-Parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 

Repository files navigation

CYK Parser

Cocke Younger Kasami algorithm written in Python.

Usage

Enter the grammar in the file grammar.py like this:

S -> AB
A -> CD|CF
B -> c|EB
C -> a
D -> b
E -> c
F -> AD
rules = {'S': ['AB'],'A': ['CD','CF'], 'B': ['c','EB'], 'C': ['a'], 'D' : ['b'], 'E' : ['c'], 'F' : ['AD']}

Start parsing with:

python cykpars.py wordToParse

Note: the script is written in Python 3 so you need to make sure to start it with the correct version.

About

Cocke–Younger–Kasami algorithm written in Python

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages