https://github.com/holmanb/levenshtein
edit distance algos: levenshtien, damerau, and hamming code
https://github.com/holmanb/levenshtein
damerau-levenshtein-distance hamming-distance levenshtein-distance rust
Last synced: 2 months ago
JSON representation
edit distance algos: levenshtien, damerau, and hamming code
- Host: GitHub
- URL: https://github.com/holmanb/levenshtein
- Owner: holmanb
- Created: 2021-11-12T14:47:44.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-11-29T19:57:33.000Z (over 4 years ago)
- Last Synced: 2025-01-20T06:19:02.939Z (over 1 year ago)
- Topics: damerau-levenshtein-distance, hamming-distance, levenshtein-distance, rust
- Language: Rust
- Homepage:
- Size: 2.93 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
LEVENSHTEIN
-----------
This project aims to correctly implement various edit distance algorithms in
the Rust programming language.
Edit distance is the minimum number of editing operations required to transform
one string into another. Multiple different edit distance categories exist.
These edit distances differ in supported operations and algorithmic complexity.
# Operations:
### Substitution
Replace one symbol with another.
Example:
```
Eleghant -> Elephant
Eleghant
|||R||||
Elephant
```
The letter 'g' is substituted with the letter 'p' in a single operation.
### Deletion
Remove one symbol.
Example:
```
Elephhant -> Elephant
Elephhant
||||D||||
Elep hant
```
The second letter 'h' is removed in a single operation.
### Insertion
Add one symbol.
Example:
```
Elehant -> Elephant
Ele hant
|||I||||
Elephant
```
The letter 'p' is added in a single operation.
### Transposition
Swap two adjacent symbols in the string.
Example:
```
Elehpant -> Elephant
Elehpant
|||SS|||
Elephant
```
The letters 'h' and 'p' are swapped in a single operation.
# Edit Distance Types:
### Hamming
Allowed Operations:
- Substitution
Note: strings must be of same length, as substitution does not change length
### Levenshtein
Allowed Operations:
- Substitution
- Deletion
- Insertion
### Damerau-Levenshtein
Allowed Operations:
- Substitution
- Deletion
- Insertion
- Substitution
### Longest common subsequence (not implemented)
Allowed Operations:
- Deletion
- Insertion
### Jaro (not implemented)
Allowed Operations:
- Transposition