StringDistance (Lucene 10.5.1 suggest API)
Description: declaration: package: org.apache.lucene.search.spell, interface: StringDistance

Package org.apache.lucene.search.spell

# Interface StringDistance

All Known Implementing Classes:
  `JaroWinklerDistance`, `LevenshteinDistance`, `LuceneLevenshteinDistance`, `NGramDistance`

public interface StringDistance
Interface for string distances.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `float`
  `getDistance(String s1, String s2)`
  Returns a float between 0 and 1 based on how similar the specified strings are to one another.

- ## Method Details

  - ### getDistance

    float getDistance(String s1, String s2)
    Returns a float between 0 and 1 based on how similar the specified strings are to one another. Returning a value of 1 means the specified strings are identical and 0 means the string are maximally different.
    Parameters:
      `s1` - The first string.
      `s2` - The second string.
    Returns:
      a float between 0 and 1 based on how similar the specified strings are to one another.