https://github.com/danieldk/seqalign
Sequence alignments
https://github.com/danieldk/seqalign
alignment damerau levenshtein sequence
Last synced: 6 months ago
JSON representation
Sequence alignments
- Host: GitHub
- URL: https://github.com/danieldk/seqalign
- Owner: danieldk
- License: apache-2.0
- Created: 2018-03-06T14:46:35.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-08-22T18:48:47.000Z (about 3 years ago)
- Last Synced: 2025-03-28T08:41:33.697Z (6 months ago)
- Topics: alignment, damerau, levenshtein, sequence
- Language: Rust
- Size: 52.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
[](https://crates.io/crates/seqalign)
[](https://docs.rs/seqalign/)
[](https://travis-ci.org/sfb833-a3/seqalign)# seqalign
## Introduction
This crate implements commonly-used sequence alignment methods based on
edit operations. There are multiple crates available to compute edit
distances. However, to my knowledge there was no crate that supports
all of the following seqalign features:* Works on slices of any type.
* Can return both the edit distance and the edit script/alignment.
* Can be extended with new measures.## Example
```rust
use seqalign::Align;
use seqalign::measures::LevenshteinDamerau;let incorrect = &['t', 'p', 'y', 'o'];
let correct = &['t', 'y', 'p', 'o', 's'];let measure = LevenshteinDamerau::new(1, 1, 1, 1);
let alignment = measure.align(incorrect, correct);// Get the edit distance
assert_eq!(2, alignment.distance());// Get the edit script.
use seqalign::measures::LevenshteinDamerauOp;
use seqalign::op::IndexedOperation;assert_eq!(vec![
IndexedOperation::new(LevenshteinDamerauOp::Match, 0, 0),
IndexedOperation::new(LevenshteinDamerauOp::Transpose(1), 1, 1),
IndexedOperation::new(LevenshteinDamerauOp::Match, 3, 3),
IndexedOperation::new(LevenshteinDamerauOp::Insert(1), 4, 4)
], alignment.edit_script());
```