The fuzzy_search library provides a set of predicates which calculate distance between words implementing levenshtein distance and damerau-levenshtein distance.
This is a simple example:
?- levenshtein_dist(append, apend, D). D = 1 ? yes ?- levenshtein_dist(append, appedn, D). D = 2 ? yes ?- ?- damerau_lev_dist(length, lenght, D). D = 1 ? yes ?-
Computes the levenshtein Distance between Word1 and Word2
Computes the Damerau-Levenshtein Distance between Word1 and Word2
Proposes atoms generated by Generator which have MaxDistance differences with Word