File tree Expand file tree Collapse file tree 1 file changed +57
-1
lines changed Expand file tree Collapse file tree 1 file changed +57
-1
lines changed Original file line number Diff line number Diff line change 1
- # cyk-algorithm
1
+ # CYK Algorithm
2
+
3
+ <p align =" left " >
4
+ <a href="https://opensource.org/licenses/MIT"><img alt="License" src="https://img.shields.io/github/license/deryeger/cyk-algorithm?style=for-the-badge"></a>
5
+ <a href="https://travis-ci.com/deryeger/cyk-algorithm"><img alt="Build" src="https://img.shields.io/travis/com/deryeger/cyk-algorithm?style=for-the-badge"></a>
6
+ <a href="https://bintray.com/deryeger/maven/cyk-algorithm"><img alt="Download" src="https://img.shields.io/bintray/dt/deryeger/maven/cyk-algorithm?style=for-the-badge"></a>
7
+ </p >
8
+
9
+ > Kotlin Multiplatform implementation of the CYK algorithm.
10
+
11
+ ## Installation
12
+
13
+ #### build.gradle.kts
14
+
15
+ ```
16
+ repositories {
17
+ maven(url = "https://dl.bintray.com/deryeger/maven")
18
+ }
19
+
20
+ dependencies {
21
+ implementation("eu.yeger:cyk-algorithm:0.2.0")
22
+ }
23
+ ```
24
+
25
+ ## Usage
26
+
27
+ This library contains two variants of the algorithm.
28
+ Both versions can be used by providing a grammar to the included parser or by programmatically generating the required model.
29
+ While the first version only computes the end result, ` runningCYK ` computes a list containing every step of the algorithm.
30
+
31
+ ```
32
+ cyk("hello world") {
33
+ grammar("S") {
34
+ """
35
+ S -> A B
36
+ A -> hello
37
+ B -> world
38
+ """.trimIndent()
39
+ }
40
+ }.getOrElse { error(it) }
41
+
42
+
43
+ runningCYK("hello world") {
44
+ grammar("S") {
45
+ """
46
+ S -> A B
47
+ A -> hello
48
+ B -> world
49
+ """.trimIndent()
50
+ }
51
+ }.getOrElse { error(it) }
52
+ ```
53
+
54
+
55
+ ## Example
56
+
57
+ An example project using this library can be found [ here] ( https://github.com/DerYeger/cyk-visualizer ) .
You can’t perform that action at this time.
0 commit comments