edu.northwestern.at.morphadorner.corpuslinguistics.stringsimilarity

## Class LetterPairSimilarity

- java.lang.Object
- - edu.northwestern.at.morphadorner.corpuslinguistics.stringsimilarity.LetterPairSimilarity

- All Implemented Interfaces:
    StringSimilarity

      public class LetterPairSimilarity
      extends java.lang.Object
      implements StringSimilarity

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LetterPairSimilarity()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected static java.lang.String[]` | `letterPairs(java.lang.String s)`
    `static double` | `letterPairSimilarity(java.lang.String s1, java.lang.String s2)` Compute letter pair similarity of two strings.
    `double` | `similarity(java.lang.String s1, java.lang.String s2)` Compute letter pair similarity of two strings.
    `protected static java.util.List<java.lang.String>` | `wordLetterPairs(java.lang.String s)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### LetterPairSimilarity

          public LetterPairSimilarity()

  - ### Method Detail

    - #### letterPairs

          protected static java.lang.String[] letterPairs(java.lang.String s)

    - #### wordLetterPairs

          protected static java.util.List<java.lang.String> wordLetterPairs(java.lang.String s)

      Returns:
        an ArrayList of 2-character Strings.

    - #### letterPairSimilarity

          public static double letterPairSimilarity(java.lang.String s1,
                                    java.lang.String s2)

      Compute letter pair similarity of two strings.
      Parameters:
        `s1` - First string.
        `s2` - Second string.
      Returns:
        Similarity measure in the range [0,1] .

    - #### similarity

          public double similarity(java.lang.String s1,
                          java.lang.String s2)

      Compute letter pair similarity of two strings.
      Specified by:
        `similarity` in interface `StringSimilarity`
      Parameters:
        `s1` - First string.
        `s2` - Second string.
      Returns:
        Similarity measure in the range [0,1] .