Package org.eobjects.analyzer.data

Examples of org.eobjects.analyzer.data.MockInputRow


    transformer.nameColumn = col;
    transformer.greetings = new String[] { "Hello" };

    assertEquals("Name (greeting)", transformer.getOutputColumns().getColumnName(0));

    assertEquals("Hello Tom", transformer.transform(new MockInputRow().put(col, "Tom"))[0]);
    assertEquals("Hello Martin", transformer.transform(new MockInputRow().put(col, "Martin"))[0]);
    assertEquals("Hello Jesse", transformer.transform(new MockInputRow().put(col, "Jesse"))[0]);
  }
View Full Code Here


    transformer.nameColumn = col;
    transformer.greetings = new String[] { "Hello", "Hi" };

    assertEquals("Name (greeting)", transformer.getOutputColumns().getColumnName(0));

    String greetingLine = transformer.transform(new MockInputRow().put(col, "Tom"))[0];
    assertTrue(greetingLine.endsWith(" Tom"));
    assertTrue(greetingLine.startsWith("Hello") || greetingLine.startsWith("Hi"));
  }
View Full Code Here

  public void testGetResult() throws Exception {
    PhoneticSimilarityFinder analyzer = new PhoneticSimilarityFinder(col);

    // 4 similar sounding kasper's
    analyzer.run(new MockInputRow().put(col, "kasper"), 1);
    analyzer.run(new MockInputRow().put(col, "gasper"), 1);
    analyzer.run(new MockInputRow().put(col, "qasper"), 1);
    analyzer.run(new MockInputRow().put(col, "kaspar"), 1);

    // 3 similar sounding hello's
    analyzer.run(new MockInputRow().put(col, "hello"), 1);
    analyzer.run(new MockInputRow().put(col, "hallo"), 1);
    analyzer.run(new MockInputRow().put(col, "hellow"), 1);

    // something without similarities
    analyzer.run(new MockInputRow().put(col, "wowsers"), 1);

    SimilarityResult result = analyzer.getResult();

    assertEquals(3, result.getSimilarValues("kasper").size());
    assertEquals("[gasper, kaspar, qasper]", result.getSimilarValues("kasper").toString());
View Full Code Here

  public void testDiacritics() throws Exception {
    PhoneticSimilarityFinder analyzer = new PhoneticSimilarityFinder(col);

    // 4 similar sounding kasper's
    analyzer.run(new MockInputRow().put(col, "Lekker"), 1);
    analyzer.run(new MockInputRow().put(col, "Lækker"), 1);
    analyzer.run(new MockInputRow().put(col, "Läkker"), 1);

    SimilarityResult result = analyzer.getResult();
    assertEquals(1, result.getSimilarityGroups().size());
  }
View Full Code Here

    assertEquals("foobar (matched part)", outputColumns.getColumnName(0));
    assertEquals("foobar (group 1)", outputColumns.getColumnName(1));
    assertEquals("foobar (group 2)", outputColumns.getColumnName(2));
    assertEquals("foobar (group 3)", outputColumns.getColumnName(3));

    assertArrayEquals(new String[] { "aabb", "aa", "bb", null }, t.transform(new MockInputRow().put(col, "aabb")));
    assertArrayEquals(new String[] { "cccc", null, null, "cccc" }, t.transform(new MockInputRow().put(col, "cccc")));
    assertArrayEquals(new String[] { null, null, null, null }, t.transform(new MockInputRow().put(col, "dddd")));
  }
View Full Code Here

TOP

Related Classes of org.eobjects.analyzer.data.MockInputRow

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.