Class MetricLCS

    • Constructor Detail

      • MetricLCS

        public MetricLCS()
    • Method Detail

      • distance

        public final double distance​(String s1,
                                     String s2)
        Distance metric based on Longest Common Subsequence, computed as 1 - |LCS(s1, s2)| / max(|s1|, |s2|).
        Specified by:
        distance in interface MetricStringDistance
        Specified by:
        distance in interface StringDistance
        Parameters:
        s1 - The first string to compare.
        s2 - The second string to compare.
        Returns:
        The computed distance metric value.
        Throws:
        NullPointerException - if s1 or s2 is null.