Understand similarity and distance interfaces
mainThe library uses specific interfaces to categorize algorithms based on their output and mathematical properties. Understanding these helps you choose the right algorithm for your use case:
Similarity Interfaces
StringSimilarity: Algorithms where 0 means strings are completely different.NormalizedStringSimilarity: Algorithms that return a similarity value between 0.0 and 1.0 (e.g., Jaro-Winkler).
Distance Interfaces
StringDistance: Algorithms where 0 means strings are identical. The maximum distance depends on the algorithm.NormalizedStringDistance: Algorithms where the distance is always between 0.0 and 1.0 (e.g.,NormalizedLevenshtein).
Metric Distances
MetricStringDistance: A subset of distances that satisfy the triangle inequalityd(x, y) <= d(x, z) + d(z, y). This is a requirement for certain nearest-neighbor search algorithms and indexing structures. Note that whileLevenshteinis a metric distance,NormalizedLevenshteinis not.