Class LongestCommonSubsequenceDistance

    • Constructor Detail

      • LongestCommonSubsequenceDistance

        public LongestCommonSubsequenceDistance()
    • Method Detail

      • apply

        public java.lang.Integer apply​(java.lang.CharSequence left,
                                       java.lang.CharSequence right)
        Calculates an edit distance between two CharSequence's left and right as: left.length() + right.length() - 2 * LCS(left, right), where LCS is given in LongestCommonSubsequence.apply(CharSequence, CharSequence).
        Specified by:
        apply in interface EditDistance<java.lang.Integer>
        Specified by:
        apply in interface SimilarityScore<java.lang.Integer>
        Parameters:
        left - first character sequence
        right - second character sequence
        Returns:
        distance
        Throws:
        java.lang.IllegalArgumentException - if either String input null