@Test public void assertScientificName() throws Exception { ParsedName pn = parser.parseQuietly("Abies sp."); assertEquals("Abies sp.", pn.getScientificName()); assertEquals("Abies spec.", pn.canonicalName()); assertEquals("Abies", pn.getGenusOrAbove()); assertEquals(Rank.SPECIES, pn.getRank()); assertNull(pn.getSpecificEpithet()); pn = parser.parseQuietly("×Abies Mill."); assertEquals("×Abies Mill.", pn.getScientificName()); assertEquals("Abies", pn.canonicalName()); assertEquals("Abies", pn.getGenusOrAbove()); assertNull(pn.getRank()); assertNull(pn.getSpecificEpithet()); assertEquals(NamePart.GENERIC, pn.getNotho()); pn = parser.parseQuietly("? hostilis Gravenhorst, 1829"); assertEquals("? hostilis Gravenhorst, 1829", pn.getScientificName()); assertEquals("? hostilis", pn.canonicalName()); assertEquals("?", pn.getGenusOrAbove()); assertEquals(Rank.SPECIES, pn.getRank()); assertEquals("hostilis", pn.getSpecificEpithet()); pn = parser.parseQuietly("unassigned Asteraceae"); assertEquals("unassigned Asteraceae", pn.getScientificName()); assertNull(pn.canonicalName()); assertNull(pn.getGenusOrAbove()); assertNull(pn.getRank()); assertNull(pn.getSpecificEpithet()); pn = parser.parseQuietly("OdontellidaeGEN"); assertEquals(NameType.PLACEHOLDER, pn.getType()); assertEquals("OdontellidaeGEN", pn.getScientificName()); assertEquals("Odontellidae", pn.canonicalName()); assertEquals("Odontellidae", pn.getGenusOrAbove()); assertEquals("GEN", pn.getStrain()); assertNull(pn.getRank()); assertNull(pn.getSpecificEpithet()); assertNull(pn.getAuthorship()); }
@Override public ParsedName parseQuietly(String scientificName, @Nullable Rank rank) { ParsedName p; try { p = parse(scientificName, rank); } catch (UnparsableException e) { p = new ParsedName(); p.setScientificName(scientificName); p.setRank(rank); p.setType(e.type); p.setParsed(false); p.setParsedPartially(false); } return p; }
NameParserGbifV1 implements NameParser { @Override public ParsedName parseQuietly(String scientificName, @Nullable Rank rank) { ParsedName p; try { p = parse(scientificName, rank); } catch (UnparsableException e) { p = new ParsedName(); p.setScientificName(scientificName); p.setRank(rank); p.setType(e.type); p.setParsed(false); p.setParsedPartially(false); } return p; } }
NameParserGbifV1 implements NameParser { @Override public ParsedName parseQuietly(String scientificName, @Nullable Rank rank) { ParsedName p; try { p = parse(scientificName, rank); } catch (UnparsableException e) { p = new ParsedName(); p.setScientificName(scientificName); p.setRank(rank); p.setType(e.type); p.setParsed(false); p.setParsedPartially(false); } return p; } NameParserGbifV1();  NameParserGbifV1(long timeout);  NameParserGbifV1(org.gbif.nameparser.api.NameParser parser); }
NameParserGbifV1 implements NameParser { @Override public ParsedName parseQuietly(String scientificName, @Nullable Rank rank) { ParsedName p; try { p = parse(scientificName, rank); } catch (UnparsableException e) { p = new ParsedName(); p.setScientificName(scientificName); p.setRank(rank); p.setType(e.type); p.setParsed(false); p.setParsedPartially(false); } return p; } NameParserGbifV1();  NameParserGbifV1(long timeout);  NameParserGbifV1(org.gbif.nameparser.api.NameParser parser); @Override ParsedName parse(String s, @Nullable Rank rank); @Override ParsedName parse(String scientificName); @Override ParsedName parseQuietly(String scientificName, @Nullable Rank rank); @Override ParsedName parseQuietly(String scientificName); @Override // parses the name without authorship and returns the ParsedName.canonicalName() string String parseToCanonical(String scientificName, @Nullable Rank rank); @Override String parseToCanonical(String scientificName); String parseToCanonicalOrScientificName(String scientificName); String parseToCanonicalOrScientificName(String scientificName, @Nullable Rank rank); }
NameParserGbifV1 implements NameParser { @Override public ParsedName parseQuietly(String scientificName, @Nullable Rank rank) { ParsedName p; try { p = parse(scientificName, rank); } catch (UnparsableException e) { p = new ParsedName(); p.setScientificName(scientificName); p.setRank(rank); p.setType(e.type); p.setParsed(false); p.setParsedPartially(false); } return p; } NameParserGbifV1();  NameParserGbifV1(long timeout);  NameParserGbifV1(org.gbif.nameparser.api.NameParser parser); @Override ParsedName parse(String s, @Nullable Rank rank); @Override ParsedName parse(String scientificName); @Override ParsedName parseQuietly(String scientificName, @Nullable Rank rank); @Override ParsedName parseQuietly(String scientificName); @Override // parses the name without authorship and returns the ParsedName.canonicalName() string String parseToCanonical(String scientificName, @Nullable Rank rank); @Override String parseToCanonical(String scientificName); String parseToCanonicalOrScientificName(String scientificName); String parseToCanonicalOrScientificName(String scientificName, @Nullable Rank rank);  }