Class SimpleRatio

  • All Implemented Interfaces:
    Applicable, Ratio

    public class SimpleRatio
    extends java.lang.Object
    implements Ratio
    • Constructor Summary

      Constructors 
      Constructor Description
      SimpleRatio()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int apply​(java.lang.String s1, java.lang.String s2)
      Computes a simple Levenshtein distance ratio between the strings
      int apply​(java.lang.String s1, java.lang.String s2, ToStringFunction<java.lang.String> sp)
      Applies the ratio between the two strings
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SimpleRatio

        public SimpleRatio()
    • Method Detail

      • apply

        public int apply​(java.lang.String s1,
                         java.lang.String s2)
        Computes a simple Levenshtein distance ratio between the strings
        Specified by:
        apply in interface Applicable
        Specified by:
        apply in interface Ratio
        Parameters:
        s1 - Input string
        s2 - Input string
        Returns:
        The resulting ratio of similarity
      • apply

        public int apply​(java.lang.String s1,
                         java.lang.String s2,
                         ToStringFunction<java.lang.String> sp)
        Description copied from interface: Ratio
        Applies the ratio between the two strings
        Specified by:
        apply in interface Ratio
        Parameters:
        s1 - Input string
        s2 - Input string
        sp - String processor to pre-process strings before calculating the ratio
        Returns:
        Integer representing ratio of similarity