Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/deryeger/cyk-algorithm
Kotlin Multiplatform implementation of the CYK algorithm.
https://github.com/deryeger/cyk-algorithm
cyk-algorithm kotlin-library kotlin-multiplatform
Last synced: about 2 months ago
JSON representation
Kotlin Multiplatform implementation of the CYK algorithm.
- Host: GitHub
- URL: https://github.com/deryeger/cyk-algorithm
- Owner: DerYeger
- License: mit
- Created: 2020-10-09T20:04:19.000Z (over 4 years ago)
- Default Branch: develop
- Last Pushed: 2021-04-05T11:42:18.000Z (almost 4 years ago)
- Last Synced: 2024-10-28T20:48:45.908Z (3 months ago)
- Topics: cyk-algorithm, kotlin-library, kotlin-multiplatform
- Language: Kotlin
- Homepage:
- Size: 185 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CYK Algorithm
> Kotlin Multiplatform implementation of the CYK algorithm.
## Installation
#### build.gradle.kts
```
repositories {
maven(url = "https://dl.bintray.com/deryeger/maven")
}dependencies {
implementation("eu.yeger:cyk-algorithm:0.2.0")
}
```## Usage
This library contains two variants of the algorithm.
Both versions can be used by providing a grammar to the included parser or by programmatically generating the required model.
While the first version only computes the end result, `runningCYK` computes a list containing every step of the algorithm.```
cyk("hello world") {
grammar("S") {
"""
S -> A B
A -> hello
B -> world
""".trimIndent()
}
}.getOrElse { error(it) }runningCYK("hello world") {
grammar("S") {
"""
S -> A B
A -> hello
B -> world
""".trimIndent()
}
}.getOrElse { error(it) }
```## Example
An example project using this library can be found [here](https://github.com/DerYeger/cyk-visualizer).
## Credits
Logo by [Magdalena Jirku](https://www.deviantart.com/keshyx).