Interface StringDistance
- All Known Implementing Classes:
DukeJaroWinklerAlgorithm
,NormalizedLevenshteinAlgorithm
,SearchAlgorithm
public interface StringDistance
An interface for string distance algorithms that calculate the difference between two byte arrays.
Implementations of this interface can compute distances or similarities between sequences of bytes,
typically representing text data. This measure can be used in search algorithms, spell checking,
text analysis, and other areas where quantifying the divergence between strings is required.
- Since:
- 2023-06-23
- Version:
- 1.0.0
- Author:
- notzune
-
Method Summary
Modifier and TypeMethodDescriptiondouble
calculate
(byte @NotNull [] x, byte @NotNull [] y) Calculates the distance or similarity between two sequences of bytes.
-
Method Details
-
calculate
double calculate(byte @NotNull [] x, byte @NotNull [] y) Calculates the distance or similarity between two sequences of bytes. The interpretation of the returned value depends on the specific algorithm implemented. For some algorithms, a lower value indicates greater similarity, while for others, a higher value may represent a closer match.- Parameters:
x
- The first byte array to be compared.y
- The second byte array to be compared.- Returns:
- A double value representing the calculated distance or similarity between the two arrays.
-