Package no.priv.garshol.duke.comparators

Examples of no.priv.garshol.duke.comparators.WeightedLevenshtein


  }

  @Test
  public void testMate() {
    // build a different configuration
    WeightedLevenshtein lev = new WeightedLevenshtein();
   
    List<Property> props = new ArrayList();
    props.add(new PropertyImpl("ID"));
    props.add(new PropertyImpl("NAME", lev, 0.2, 0.9));
    props.add(new PropertyImpl("EMAIL", lev, 0.2, 0.9));
View Full Code Here


    assertEquals(3.0, WeightedLevenshtein.distance("totanic 1", "titanic 2", e));
  }

  @Test
  public void testComparator() {
    WeightedLevenshtein comp = new WeightedLevenshtein();
    assertEquals(0.0, comp.compare("1", ""));
  }
View Full Code Here

    Configuration config = ConfigLoader.load("classpath:config-custom-estimator.xml");

    List<Comparator> comparators = config.getCustomComparators();
    assertEquals(1, comparators.size());

    WeightedLevenshtein wl = (WeightedLevenshtein) comparators.get(0);
    DefaultWeightEstimator est = (DefaultWeightEstimator) wl.getEstimator();
    assertEquals(3.8, est.getDigitWeight());
  }
View Full Code Here

TOP

Related Classes of no.priv.garshol.duke.comparators.WeightedLevenshtein

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.