test_class.declarator: e
test_class.modifier: private
test_class.original_string: private WeightedLevenshtein.DefaultWeightEstimator e;
test_class.type: WeightedLevenshtein.DefaultWeightEstimator
test_class.var_name: e
test_class.file: lib/Duke/duke-core/src/test/java/no/priv/garshol/duke/comparators/WeightedLevenshteinTest.java
test_class.identifier: WeightedLevenshteinTest
test_case.body: @Test
    public void testComparator() {
      WeightedLevenshtein comp = new WeightedLevenshtein();
      assertEquals(0.0, comp.compare("1", ""));
    }
test_case.class_method_signature: WeightedLevenshteinTest.testComparator()
test_case.full_signature: @Test public void testComparator()
test_case.identifier: testComparator
test_case.invocations: assertEquals compare
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testComparator()
focal_class.declarator: estimator
focal_class.modifier: private
focal_class.original_string: private WeightEstimator estimator;
focal_class.type: WeightEstimator
focal_class.var_name: estimator
focal_class.file: lib/Duke/duke-core/src/main/java/no/priv/garshol/duke/comparators/WeightedLevenshtein.java
focal_class.identifier: WeightedLevenshtein
focal_class.interfaces: implements Comparator
focal_class.class_method_signature: WeightedLevenshtein.WeightedLevenshtein()
focal_class.full_signature: public  WeightedLevenshtein()
focal_class.identifier: WeightedLevenshtein
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  WeightedLevenshtein()
focal_class.class_method_signature: WeightedLevenshtein.compare(String s1, String s2)
focal_class.full_signature: @Override public double compare(String s1, String s2)
focal_class.identifier: compare
focal_class.modifiers: @Override public
focal_class.parameters: (String s1, String s2)
focal_class.return: double
focal_class.signature: double compare(String s1, String s2)
focal_class.class_method_signature: WeightedLevenshtein.isTokenized()
focal_class.full_signature: @Override public boolean isTokenized()
focal_class.identifier: isTokenized
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isTokenized()
focal_class.class_method_signature: WeightedLevenshtein.setEstimator(WeightEstimator estimator)
focal_class.full_signature: public void setEstimator(WeightEstimator estimator)
focal_class.identifier: setEstimator
focal_class.modifiers: public
focal_class.parameters: (WeightEstimator estimator)
focal_class.return: void
focal_class.signature: void setEstimator(WeightEstimator estimator)
focal_class.class_method_signature: WeightedLevenshtein.getEstimator()
focal_class.full_signature: public WeightEstimator getEstimator()
focal_class.identifier: getEstimator
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: WeightEstimator
focal_class.signature: WeightEstimator getEstimator()
focal_class.class_method_signature: WeightedLevenshtein.distance(String s1, String s2, WeightEstimator weight)
focal_class.full_signature: public static double distance(String s1, String s2, WeightEstimator weight)
focal_class.identifier: distance
focal_class.modifiers: public static
focal_class.parameters: (String s1, String s2, WeightEstimator weight)
focal_class.return: double
focal_class.signature: double distance(String s1, String s2, WeightEstimator weight)
focal_class.class_method_signature: WeightedLevenshtein.estimateCharacters(String s, WeightEstimator e)
focal_class.full_signature: private static double estimateCharacters(String s, WeightEstimator e)
focal_class.identifier: estimateCharacters
focal_class.modifiers: private static
focal_class.parameters: (String s, WeightEstimator e)
focal_class.return: double
focal_class.signature: double estimateCharacters(String s, WeightEstimator e)
focal_method.body: @Override
  public double compare(String s1, String s2) {
      // if the strings are equal we can stop right here.
      if (s1.equals(s2))
        return 1.0;
  
      // we couldn't shortcut, so now we go ahead and compute the full
      // matrix
      int len = Math.min(s1.length(), s2.length());
      double dist = distance(s1, s2, estimator);
      if (dist > len)
        // because of weights it's possible for the distance to be
        // greater than the length. if so, we return zero rather than a
        // negative distance.
        return 0.0;
      return 1.0 - (dist / (len));
    }
focal_method.class_method_signature: WeightedLevenshtein.compare(String s1, String s2)
focal_method.full_signature: @Override public double compare(String s1, String s2)
focal_method.identifier: compare
focal_method.invocations: equals min length length distance
focal_method.modifiers: @Override public
focal_method.parameters: (String s1, String s2)
focal_method.return: double
focal_method.signature: double compare(String s1, String s2)