public class NameParserGbifV1 extends Object implements NameParser
Constructor and Description |
---|
NameParserGbifV1()
Using the default GBIF RegEx Name Parser.
|
NameParserGbifV1(long timeout)
Using the default GBIF RegEx Name Parser with a given timeout for parsing a single name.
|
NameParserGbifV1(org.gbif.nameparser.NameParserGBIF parser) |
Modifier and Type | Method and Description |
---|---|
static org.gbif.nameparser.api.Rank |
fromGbif(Rank rank) |
static NameType |
gbifNameType(org.gbif.nameparser.api.ParsedName pn) |
long |
getTimeout() |
ParsedName |
parse(String scientificName)
Delegate method to parse a scientific name of unknown rank.
|
ParsedName |
parse(String s,
Rank rank)
Fully parse the supplied name also trying to extract authorships, a conceptual sec reference, remarks or notes
on the nomenclatural status.
|
ParsedName |
parseQuietly(String scientificName)
Delegate method to parse a scientific name of unknown rank quietly.
|
ParsedName |
parseQuietly(String scientificName,
Rank rank)
Fully parses a name using #parse(String, Rank) but converts names that throw a UnparsableException
into ParsedName objects with the scientific name, rank and name type given.
|
String |
parseToCanonical(String scientificName)
Delegate method to parse a scientific name of unknown rank and return its canonical form.
|
String |
parseToCanonical(String scientificName,
Rank rank)
Parses the scientific name without authorship and returns the ParsedName.canonicalName() string
|
String |
parseToCanonicalOrScientificName(String scientificName) |
String |
parseToCanonicalOrScientificName(String scientificName,
Rank rank)
Tries to parses the name without authorship and returns the ParsedName.canonicalName() string
For unparsable types and other UnparsableExceptions the original scientific name is returned.
|
void |
setTimeout(long timeout) |
static NamePart |
toGbif(org.gbif.nameparser.api.NamePart notho) |
static Rank |
toGbif(org.gbif.nameparser.api.Rank rank) |
public NameParserGbifV1()
public NameParserGbifV1(long timeout)
timeout
- in milliseconds before returning an Unparsable namepublic NameParserGbifV1(org.gbif.nameparser.NameParserGBIF parser)
public long getTimeout()
public void setTimeout(long timeout)
public ParsedName parse(String s, @Nullable Rank rank) throws UnparsableException
NameParser
parse
in interface NameParser
s
- the full scientific name to parserank
- the rank of the name if it is known externally. Helps identifying infrageneric names vs bracket authorsUnparsableException
public ParsedName parse(String scientificName) throws UnparsableException
NameParser
parse
in interface NameParser
UnparsableException
public ParsedName parseQuietly(String scientificName, @Nullable Rank rank)
NameParser
parseQuietly
in interface NameParser
public ParsedName parseQuietly(String scientificName)
NameParser
parseQuietly
in interface NameParser
public String parseToCanonical(String scientificName, @Nullable Rank rank)
NameParser
parseToCanonical
in interface NameParser
scientificName
- the full scientific name to parserank
- the rank of the name if it is known externally. Helps identifying infrageneric names vs bracket authorspublic String parseToCanonical(String scientificName)
NameParser
parseToCanonical
in interface NameParser
public String parseToCanonicalOrScientificName(String scientificName)
public String parseToCanonicalOrScientificName(String scientificName, @Nullable Rank rank)
rank
- the rank of the name if it is known externally. Helps identifying infrageneric names vs bracket authorspublic static NameType gbifNameType(org.gbif.nameparser.api.ParsedName pn)
Copyright © 2024 Global Biodiversity Information Facility (GBIF). All rights reserved.