com.github.dylon.liblevenshtein.levenshtein.distance.IDistance Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of liblevenshtein Show documentation
Show all versions of liblevenshtein Show documentation
A library for spelling-correction based on Levenshtein Automata.
package com.github.dylon.liblevenshtein.levenshtein.distance;
import java.io.Serializable;
/**
* Specifies the interface that all distance functions must implement.
* @param Type of the term whose distance is being determined.
* @author Dylon Edwards
* @since 2.1.0
*/
public interface IDistance extends Serializable {
/**
* Finds the distance between two terms, {@code v} and {@code w}. The distance
* between two terms is complemented by their similarity, which is determined
* by subtracting their distance from the maximum distance they may be apart.
* @param v Term to compare with {@code w}
* @param w Term to compare with {@code v}
* @return Distance between {@code v} and {@code w}
*/
int between(Term v, Term w);
}