@Test public void testBlattariaAuthors() throws Exception { ParsedName p1 = new ParsedName(); p1.setAuthorship("P. Miller"); p1.setYear("1754"); ParsedName p2 = new ParsedName(); p2.setAuthorship("O. Kuntze"); p2.setYear("1891"); ParsedName p3 = new ParsedName(); p3.setAuthorship("Voet, ?"); p3.setYear("1806"); ParsedName p4 = new ParsedName(); p4.setAuthorship("Weyenbergh"); p4.setYear("1874"); List<ParsedName> names = Lists.newArrayList(p1, p2, p3, p4); for (ParsedName p : names) { if (!p1.equals(p)) { assertEquals(Equality.DIFFERENT, comp.compare(p1, p)); } if (!p2.equals(p)) { assertEquals(Equality.DIFFERENT, comp.compare(p2, p)); } if (!p3.equals(p)) { assertEquals(Equality.DIFFERENT, comp.compare(p3, p)); } if (!p4.equals(p)) { assertEquals(Equality.DIFFERENT, comp.compare(p4, p)); } } }
public Equality compare(@Nullable String authors1, @Nullable String year1, @Nullable String authors2, @Nullable String year2) { Equality result = compareAuthorteam(authors1, authors2, minCommonSubstring, MIN_AUTHOR_LENGTH_WITHOUT_LOOKUP); if (result != Equality.EQUAL) { Equality yresult = new YearComparator(year1, year2).compare(); if (yresult != Equality.UNKNOWN) { result = yresult; } } return result; }
AuthorComparator { public Equality compare(@Nullable String authors1, @Nullable String year1, @Nullable String authors2, @Nullable String year2) { Equality result = compareAuthorteam(authors1, authors2, minCommonSubstring, MIN_AUTHOR_LENGTH_WITHOUT_LOOKUP); if (result != Equality.EQUAL) { Equality yresult = new YearComparator(year1, year2).compare(); if (yresult != Equality.UNKNOWN) { result = yresult; } } return result; } }
AuthorComparator { public Equality compare(@Nullable String authors1, @Nullable String year1, @Nullable String authors2, @Nullable String year2) { Equality result = compareAuthorteam(authors1, authors2, minCommonSubstring, MIN_AUTHOR_LENGTH_WITHOUT_LOOKUP); if (result != Equality.EQUAL) { Equality yresult = new YearComparator(year1, year2).compare(); if (yresult != Equality.UNKNOWN) { result = yresult; } } return result; } private  AuthorComparator(Map<String, String> authors); }
AuthorComparator { public Equality compare(@Nullable String authors1, @Nullable String year1, @Nullable String authors2, @Nullable String year2) { Equality result = compareAuthorteam(authors1, authors2, minCommonSubstring, MIN_AUTHOR_LENGTH_WITHOUT_LOOKUP); if (result != Equality.EQUAL) { Equality yresult = new YearComparator(year1, year2).compare(); if (yresult != Equality.UNKNOWN) { result = yresult; } } return result; } private  AuthorComparator(Map<String, String> authors); static AuthorComparator createWithoutAuthormap(); static AuthorComparator createWithAuthormap(); static AuthorComparator createWithAuthormap(Map<String, String> authorMap); Equality compare(@Nullable String authors1, @Nullable String year1, @Nullable String authors2, @Nullable String year2); Equality compare(ParsedName n1, ParsedName n2); boolean compareStrict(String author1, @Nullable String year1, String author2, @Nullable String year2); }
AuthorComparator { public Equality compare(@Nullable String authors1, @Nullable String year1, @Nullable String authors2, @Nullable String year2) { Equality result = compareAuthorteam(authors1, authors2, minCommonSubstring, MIN_AUTHOR_LENGTH_WITHOUT_LOOKUP); if (result != Equality.EQUAL) { Equality yresult = new YearComparator(year1, year2).compare(); if (yresult != Equality.UNKNOWN) { result = yresult; } } return result; } private  AuthorComparator(Map<String, String> authors); static AuthorComparator createWithoutAuthormap(); static AuthorComparator createWithAuthormap(); static AuthorComparator createWithAuthormap(Map<String, String> authorMap); Equality compare(@Nullable String authors1, @Nullable String year1, @Nullable String authors2, @Nullable String year2); Equality compare(ParsedName n1, ParsedName n2); boolean compareStrict(String author1, @Nullable String year1, String author2, @Nullable String year2);  }