Workflow Status

This library provides functions to show the differences between two strings. It uses the Levenshtein distance to compute the minimum number of edit operations: insertions, deletions, substitutions needed to go from one string to the other.

Several options are available to customize this processing:

// "between the e and the n the letter i was added" asserteq!(showdistance("kitten", "kittein"), "kitte[+i]n");

// "at the end of the text 3 letters have been deleted" asserteq!(showdistance("kitten", "kit"), "kit[-t-e-n]");

// "between the t and the n 2 letters have been modified" asserteq!(showdistance("kitten", "kitsin"), "kit[~t/s~e/i]n");

// "between the t and the n 2 letters have been modified" let mysplitsize = SplitSize { splitsize: 300 }; asserteq!(showdistancewith(mysplitsize, defaultdisplayoptions(), "kitten", "kitsin"), "kit[~t/s~e/i]n"); ```

The output can also be coloured. For example:

Try it in a REPL

You can try this library in a REPL:

```sh

:dep edits = { path = "." } use edits::edits::*; ```