use of edu.illinois.cs.cogcomp.sim.NESim in project cogcomp-nlp by CogComp.
the class EntityComparisonTest method testEntityComparison.
@Test
public void testEntityComparison() {
Metric ec = new NESim();
String hitchA = "Bill C. Hitchcock";
String hitchB = "William Hitchcock";
String hitchC = "Mrs. Hitchcock";
String hitchD = "Arthur Hitchcock";
String hitchE = "Bill F. Hitchcock";
MetricResponse result = ec.compare(hitchA, hitchB);
assertEquals(result.score, 1.0, 0.01);
/**
* this test FAILS: no gender test
*/
result = ec.compare(hitchB, hitchC);
// assertTrue(Double.parseDouble(result.get(EntityComparison.SCORE)) <
// 0.5);
result = ec.compare(hitchB, hitchD);
assertTrue(result.score < 0.6);
result = ec.compare(hitchA, hitchE);
// Another test that fails. Critical local difference.
// assertTrue( Double.parseDouble( result.get( EntityComparison.SCORE )
// ) < 0.6 );
}
use of edu.illinois.cs.cogcomp.sim.NESim in project cogcomp-nlp by CogComp.
the class WordComparator method SetAs_NEComparator.
/**
* only used to initialize the NE comparator
*
* @throws IllegalArgumentException
* @throws IOException
*/
public void SetAs_NEComparator() throws IllegalArgumentException, IOException {
System.out.println("set Name entity comparator");
this.wordSim = new NESim();
}
Aggregations