Package no.priv.garshol.duke

Examples of no.priv.garshol.duke.PropertyImpl


    cfg.addDataSource(0, csv);

    Comparator cmp = new ExactComparator();

    List<Property> props = new ArrayList();
    props.add(new PropertyImpl("id"));
    props.add(new PropertyImpl("name", cmp, 0.0, 1.0));
    props.add(new PropertyImpl("age", cmp, 0.0, 1.0));

    cfg.setProperties(props);

    GeneticAlgorithm gen = new GeneticAlgorithm(cfg, tstfile.getAbsolutePath(),
                                                true);
View Full Code Here


  public void setup() {
   
    config1 = new ConfigurationImpl()
   
    List<Property> props = new ArrayList<Property>();
    props.add(new PropertyImpl("ID"));
    props.add(new PropertyImpl(propName, null, 0.3, 0.8));   
   
    ((ConfigurationImpl) config1).setProperties(props);
    ((ConfigurationImpl) config1).setThreshold(0.85);
  }
View Full Code Here

  }

  @Test
  public void canAddCustomComparator() {
    GeneticConfiguration conf = new GeneticConfiguration(config1);     
  Property aspectProp = new PropertyImpl(propName, null, 0.5, 0.5);
  List<Comparator> compList = new ArrayList<Comparator>();
  compList.add(comparator);
  ComparatorAspect aspect = new ComparatorAspect(aspectProp, compList);
 
  aspect.setRandomly(conf);
View Full Code Here

  @Before
  public void setup() {
    Levenshtein lev = new Levenshtein();
   
    List<Property> props = new ArrayList();
    props.add(new PropertyImpl("ID"));
    props.add(new PropertyImpl("NAME", lev, 0.3, 0.8));
    props.add(new PropertyImpl("EMAIL", lev, 0.3, 0.8));
   
    config1 = new ConfigurationImpl();
    ((ConfigurationImpl) config1).setProperties(props);
    ((ConfigurationImpl) config1).setThreshold(0.85);
  }
View Full Code Here

  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));
   
    Configuration other = new ConfigurationImpl();
    ((ConfigurationImpl) other).setProperties(props);
    ((ConfigurationImpl) other).setThreshold(0.75);
    GeneticConfiguration g_other = new GeneticConfiguration(other);
View Full Code Here

 
  @Test
  public void testTrivial() throws IOException {
    ExactComparator comp = new ExactComparator();
    List<Property> props = new ArrayList();
    props.add(new PropertyImpl("ID"));
    Property name = new PropertyImpl("NAME", comp, 0.3, 0.8);
    props.add(name);
    Property email = new PropertyImpl("EMAIL", comp, 0.3, 0.8);
    props.add(email);

    ConfigurationImpl config = new ConfigurationImpl();
    config.setThreshold(0.85);
    config.setProperties(props);
View Full Code Here

 
  @Test
  public void testWithZeroes() throws IOException {
    ExactComparator comp = new ExactComparator();
    List<Property> props = new ArrayList();
    props.add(new PropertyImpl("ID"));
    Property name = new PropertyImpl("NAME", comp, 0.3, 0.8);
    props.add(name);
    Property email = new PropertyImpl("EMAIL", comp, 0.3, 0.8);
    props.add(email);
    props.add(new PropertyImpl("IGNORE", comp, 0.0, 0.0));

    ConfigurationImpl config = new ConfigurationImpl();
    config.setThreshold(0.85);
    config.setProperties(props);
View Full Code Here

 
  @Test
  public void testJustOne() throws IOException {
    ExactComparator comp = new ExactComparator();
    List<Property> props = new ArrayList();
    props.add(new PropertyImpl("ID"));
    Property name = new PropertyImpl("NAME", comp, 0.0, 1.0);
    props.add(name);
    props.add(new PropertyImpl("EMAIL", comp, 0.0, 0.0));
    props.add(new PropertyImpl("IGNORE", comp, 0.0, 0.0));
    props.add(new PropertyImpl("IGNORE2", comp, 0.0, 0.0));

    ConfigurationImpl config = new ConfigurationImpl();
    config.setThreshold(0.85);
    config.setProperties(props);
View Full Code Here

 
  @Test
  public void testNoIdProperties() throws IOException {
    ExactComparator comp = new ExactComparator();
    List<Property> props = new ArrayList();
    Property name = new PropertyImpl("NAME", comp, 0.3, 0.8);
    props.add(name);
    Property email = new PropertyImpl("EMAIL", comp, 0.3, 0.8);
    props.add(email);

    ConfigurationImpl config = new ConfigurationImpl();
    config.setThreshold(0.85);
    config.setProperties(props);
View Full Code Here

 
  @Test
  public void testThresholdTooHigh() throws IOException {
    ExactComparator comp = new ExactComparator();
    List<Property> props = new ArrayList();
    props.add(new PropertyImpl("ID"));
    Property name = new PropertyImpl("NAME", comp, 0.3, 0.8);
    props.add(name);
    Property email = new PropertyImpl("EMAIL", comp, 0.3, 0.8);
    props.add(email);

    ConfigurationImpl config = new ConfigurationImpl();
    config.setThreshold(1.0);
    config.setProperties(props);
View Full Code Here

TOP

Related Classes of no.priv.garshol.duke.PropertyImpl

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.