Package no.priv.garshol.duke.cleaners

Examples of no.priv.garshol.duke.cleaners.RegexpCleaner


  public void testEndYear() {
    test("-(\\d\\d\\d\\d)$", "1850-1888", "1888");
  }

  private void test(String regexp, String value, String result) {
    RegexpCleaner cl = new RegexpCleaner();
    cl.setRegexp(regexp);
    assertEquals(result, cl.clean(value));
  }
View Full Code Here


"<http://data.deichman.no/person/ahlgren_ernst_1850-1888> <http://www.foafrealm.org/xfoaf/0.1/nationality> <http://data.deichman.no/nationality/sv> .\n" +
"<http://data.deichman.no/person/ahlgren_ernst_1850-1888> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .\n" +
"<http://data.deichman.no/person/ahlgren_ernst_1850-1888> <http://xmlns.com/foaf/0.1/name> \"Ahlgren, Ernst\" .\n" +
"<http://data.deichman.no/person/ahlgren_ernst_1850-1888> <http://xmlns.com/foaf/0.1/title> \"psevd. for Victoria Benedictsson\" .\n";

    RegexpCleaner birthcleaner = new RegexpCleaner();
    birthcleaner.setRegexp("^(\\d\\d\\d\\d)-");
    RegexpCleaner deathcleaner = new RegexpCleaner();
    deathcleaner.setRegexp("-(\\d\\d\\d\\d)$");
   
    source.addColumn(new Column("?uri", "ID", null, null));   
    source.addColumn(new Column("http://xmlns.com/foaf/0.1/name", "NAME",
                                null, new FamilyCommaGivenCleaner()));
    source.addColumn(new Column("http://data.deichman.no/lifespan",
View Full Code Here

  @Test
  public void testOneRowMapColumnTwice() {
    perform("insert into testdata values (1, 'smith, john')");

    RegexpCleaner givencleaner = new RegexpCleaner();
    givencleaner.setRegexp(", (.+)");
    RegexpCleaner familycleaner = new RegexpCleaner();
    familycleaner.setRegexp("^([^,]+), ");
   
    source.addColumn(new Column("ID", null, null, null));
    source.addColumn(new Column("NAME", "GIVENNAME", null, givencleaner));
    source.addColumn(new Column("NAME", "FAMILYNAME", null, familycleaner));
       
View Full Code Here

TOP

Related Classes of no.priv.garshol.duke.cleaners.RegexpCleaner

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.