Skip to content

Commit 1745118

Browse files
Update README.md
1 parent 9cecd79 commit 1745118

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,22 @@
11
# CKYAlgorithm
2-
This project is about implementation of Cocke-Younger-Kasami Algorithm for acceptance of string of a Context Free Grammar.
2+
This project is about the simplest implementation of Cocke-Younger-Kasami (CYK) Algorithm (using 2D String array in Java Netbeans) for acceptance of string of a Context Free Grammar.
3+
4+
Input : Grammar in 2D String array in the show format, Input string in a 1D String array
5+
6+
Output : The java program will generate a table using the CYK Algorithm.
7+
The String will be acceptable if the last cell of the first row of the table contains the Start Symbol. (which in the sample grammar is 'S')
8+
9+
Notations :
10+
If the Grammar has the following 4 productions :
11+
S->AB/BC
12+
A->BA/a
13+
B->CC/b
14+
C->AB/a
15+
Then it will be stored in a 2D String Array eliminating the '->' and '/' symbols.
16+
String G[4][3]={{"S","AB","BC"},
17+
{"A","BA","a"},
18+
{"B","CC","b"},
19+
{"C","AB","a"}};
20+
21+
If the input string is "baaba" then it will be stored in a 1D String :
22+
String w[]={"b","a","a","b","a"};

0 commit comments

Comments
 (0)