A fuzzy search and word metric library

Author(s): Isabel Garcia-Contreras.

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
?-
```

Documentation on exports

Usage:levenshtein_dist(Word1,Word2,Distance)

Computes the levenshtein Distance between Word1 and Word2

• The following properties should hold at call time:
Word1 is currently instantiated to an atom.
Word2 is currently instantiated to an atom.
Distance is a free variable.
• The following properties should hold upon exit:
Word1 is currently instantiated to an atom.
Word2 is currently instantiated to an atom.
Distance is a number.

Usage:damerau_lev_dist(Word1,Word2,Distance)

Computes the Damerau-Levenshtein Distance between Word1 and Word2

• The following properties should hold at call time:
Word1 is currently instantiated to an atom.
Word2 is currently instantiated to an atom.
Distance is a free variable.
• The following properties should hold upon exit:
Word1 is currently instantiated to an atom.
Word2 is currently instantiated to an atom.
Distance is a number.

Usage:fuzzy_search(Word,Generator,Metric,MaxDistance,Suggestion)

Proposes atoms generated by Generator which have MaxDistance differences with Word

• The following properties should hold at call time:
Word is currently instantiated to an atom.
Generator is currently instantiated to an atom.
Metric is currently instantiated to an atom.
MaxDistance is a number.
Suggestion is a free variable.
• The following properties should hold upon exit:
Word is currently instantiated to an atom.
Generator is currently instantiated to an atom.
Metric is currently instantiated to an atom.
MaxDistance is a number.
Suggestion is currently instantiated to an atom.
Meta-predicate with arguments: fuzzy_search(?,pred(1),pred(3),?,?).

Documentation on imports

This module has the following direct dependencies:

Known bugs and planned improvements

• Using 1000000 as inf limits word size to 1000000-1