https://github.com/vmchale/edit-distance
Levenshtein edit distance, packaged for ATS
https://github.com/vmchale/edit-distance
Last synced: 3 months ago
JSON representation
Levenshtein edit distance, packaged for ATS
- Host: GitHub
- URL: https://github.com/vmchale/edit-distance
- Owner: vmchale
- License: bsd-3-clause
- Created: 2018-07-13T18:48:58.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-04-11T14:41:05.000Z (almost 4 years ago)
- Last Synced: 2025-01-08T12:08:13.896Z (about 1 year ago)
- Language: ATS
- Size: 51.8 KB
- Stars: 12
- Watchers: 4
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# edit-distance
[](https://travis-ci.org/vmchale/edit-distance)
The Levenshtein edit distance, packaged for ATS. This implementation is written
in safe ATS and is performant.
## Building
### For Hacking
To run the test suite, first install
[atspkg](http://hackage.haskell.org/package/ats-pkg). The simplest way to do so
is to run
```
curl -sSl https://raw.githubusercontent.com/vmchale/atspkg/master/bash/install.sh | sh -s
```
Thereafter, you can run
```
atspkg test
```
to hack on the library.
### For Use
You can use the `edit-distance` package in `atspkg` projects with something like
the example in
[polyglot](https://github.com/vmchale/polyglot/blob/master/atspkg.dhall#L73).
Currently, there is no NPM release for this package; however, there is nothing
stopping you from using the tarballs or git repository to use this package
conventionally using NPM.
## Benchmarks
| Language | Library | Unicode | Time |
| -------- | ------- | ------- | ---- |
| ATS | `edit-distance` | | 67.61 ns |
| Rust | `levenshtein-rs` | X | 137.4 ns
| Rust | `strsim` | X | 140.4 ns
| Haskell | `edit-distance` | X | 413.5 ns |
| C | n/a | | 93.70 ns |
Note that these benchmarks use `libgc` for ATS and C and thus ATS and
C functions may be faster if you use manual memory management.