Skip to content

mzsuetam/CYK-Parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CYK Parser

Cocke–Younger–Kasami (CYK) algorithm - parsing algorithm for context-free grammars. This (standard) version of CYK operates on context-free grammars given in Chomsky normal form (CNF).

Context free grammar

G = (T,N,P,S)
T - set of terminals
N - set of non-terminals
P - set of productions
S - start symbol

Grammar file

By default, grammar file is read from ./grammar.txt. The path can be specified by flag -path with a path to file as parameter.

File consist of four lines:

  1. list of terminals separated by space
  2. list of non-terminals separated by space
  3. list of productions separated by space
  4. start symbol (non-terminal)

Terminal t is represented by single [a-z] char,
a non-terminal N is represented by a single [A-Z] char
and production are represented by N>(NN|t|) string
(where N> is interpreted as epsilon production)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published