org.apache.stanbol.entityhub.jersey.grefine
Class Utils

java.lang.Object
  extended by org.apache.stanbol.entityhub.jersey.grefine.Utils

public class Utils
extends Object


Constructor Summary
Utils()
           
 
Method Summary
static double levenshtein(String s1, String s2)
          Compares two strings (after trimming by using the Levenshtein's Edit Distance of the two strings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utils

public Utils()
Method Detail

levenshtein

public static double levenshtein(String s1,
                                 String s2)
Compares two strings (after trimming by using the Levenshtein's Edit Distance of the two strings. Does not return the Integer number of changes but 1-(changes/maxStringSizeAfterTrim)

Parameters:
s1 - the first string
s2 - the second string
Returns:
the distance
Throws:
IllegalArgumentException - if any of the two parsed strings is NULL


Copyright © 2010-2013 The Apache Software Foundation. All Rights Reserved.