stringedits contains the Edit trait, which provides access to a number of iterators for small edits to strings. Based off the article How to Write A Spelling Corrector by Peter Norvig. Available under the MIT license.
assert_eq!(vec!["!foo", "f!oo", "fo!o", "foo!"], "foo".inserts(&['!']).collect::<Vec<String>>());
Iterator over all the words formed from the replacement of a character in a word with each letter in it's custom alphabet see Edit::replaces
Iterator over all the words formed from the delition of a single character from a word. See Edit::deletions
Iterator over all the distance-1 edits of a word; deletion, insertion, or replacement of one character, or transposition of two characters. See Edit::dist1edits
Iterator over all the distance-2 edits of a word. See Edit::dist2edits This stores a fairly large hashset & vector (of distance-1 edits) internally, so it's not nearly as lightweight as the other iterator adaptors. I'd like to come up with a more elegant solution if I can, but I'd have to wrestle with lifetimes a lot.
Iterator over all the words formed from the insertion of a letter in a...z in any position in a word, including before the first character and after the last see Edit::inserts
Iterator over all the words formed from the replacement of a character in a word with a letter in a...z see Edit::replaces
Iterator over all the splits at a single position of a word. See Edit::splits
Iterator over all transpositions of a single position of a word. See Edit::transposes
The characters from 'a'..='z'.
The characters from 'A'..='Z'.
The Edit trait provides access to a number of iterators for single-and-double character edits of a string.
It is implemented for any type that implements