@Test public void testUnparsedAuthors() throws Exception { ParsedName p3 = new ParsedName(); p3.setParsed(false); p3.setScientificName("Blattaria Voet, ?, 1806"); p3.setGenusOrAbove("Blattaria"); ParsedName p4 = new ParsedName(); p4.setScientificName("Blattaria Weyenbergh, 1874"); p4.setAuthorship("Weyenbergh"); p4.setYear("1874"); assertEquals(Equality.UNKNOWN, comp.compare(p3, p4)); p3.setYear("1874"); assertEquals(Equality.EQUAL, comp.compare(p3, p4)); }
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);  }