Package org.gbif.api.model.checklistbank
Class ParsedName
- java.lang.Object
-
- org.gbif.api.model.checklistbank.ParsedName
-
public class ParsedName extends Object
A container of a taxon name that is atomised into its relevant, separate parts.
Hybrid formulas that consist of multiple genera, binomials or species epithets are relatively poorly represented. A simple boolean flag indicates a hybrid formula, e.g. Polygala vulgaris × Polygala epinema but not named hybrids that are have an × or notho as part of a well-formed mono/bi/trinomial e.g. ×Polygala vulgaris. In the case of hybrid formulas, i.e. isHybrid=true, the first name in the formula is tried to be kept, at least the genus. A container of a taxon name that is only atomised into three name parts maximum plus rank and a notho property indicating the name part of named hybrids that is considered to be the hybrid. No authorship is kept. For subgenera we don't use parentheses to indicate the subgenus, but use explicit rank markers instead.
-
-
Field Summary
Fields Modifier and Type Field Description static Character
HYBRID_MARKER
-
Constructor Summary
Constructors Constructor Description ParsedName()
ParsedName(NameType type, String genusOrAbove, String infraGeneric, String specificEpithet, String infraSpecificEpithet, NamePart notho, Rank rank, String authorship, String year, String bracketAuthorship, String bracketYear, String cultivarEpithet, String strain, String sensu, String nomStatus, String remarks)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
authorshipComplete()
String
buildName(boolean hybridMarker, boolean rankMarker, boolean authorship, boolean infrageneric, boolean genusForInfrageneric, boolean abbreviateGenus, boolean decomposition, boolean asciiOnly, boolean showIndet, boolean nomNote, boolean remarks, boolean showSensu, boolean showCultivar, boolean showStrain)
build a name controlling all available flags for name parts to be included in the resulting name.String
canonicalName()
The canonical name sensu strictu with nothing else but 3 name parts at max (genus, species, infraspecific).String
canonicalNameComplete()
The code-compliant, canonical name with rank and hybrid marker, authorship and cultivar or strain name included.String
canonicalNameWithMarker()
The code-compliant, canonical name with three name parts at max (genus, species, infraspecific), a rank marker for infraspecific names and cultivar or strain epithets.String
canonicalSpeciesName()
boolean
equals(Object o)
String
fullName()
String
getAuthorship()
The original author of this name, e.g.String
getBracketAuthorship()
The authorship of the original name, i.e.String
getBracketYear()
The code relevant year of publication of the original name, i.e.Integer
getBracketYearInt()
String
getCultivarEpithet()
The cultivar, cultivar group or grex part of a cultivated plant name.String
getGenusOrAbove()
The genus part of a bi/trinomial or the monomial in case of names of higher ranksString
getInfraGeneric()
The infrageneric part of a name, often given in parentheses between genus and species epithet, e.g.String
getInfraSpecificEpithet()
Integer
getKey()
String
getNomStatus()
Any nomenclatoral remarks given in this name, e.g.NamePart
getNotho()
For hybrid names notho indicates which part of the name is considered a hybrid, i.e.Rank
getRank()
String
getRemarks()
Any further remarks foundString
getScientificName()
The exact verbatim, full scientific name as given before parsing.String
getSensu()
Taxon concept references as part of the name, e.g.String
getSpecificEpithet()
String
getStrain()
The strain or isolate name.String
getTerminalEpithet()
NameType
getType()
A coarse classification of names helping to deal with different syntactical name string structures.String
getYear()
The year of publication as given in the authorship.Integer
getYearInt()
boolean
hasAuthorship()
int
hashCode()
boolean
isAutonym()
boolean
isBinomial()
boolean
isHybridFormula()
boolean
isIndetermined()
boolean
isParsableType()
boolean
isParsed()
A flag indicating if a name could not be parsed at all.boolean
isParsedPartially()
The GBIF name parser cannot always parse the entire name.boolean
isQualified()
boolean
isRecombination()
void
setAuthorship(String authorship)
void
setBracketAuthorship(String bracketAuthorship)
void
setBracketYear(String bracketYear)
void
setCultivarEpithet(String cultivarEpithet)
void
setGenusOrAbove(String genusOrAbove)
void
setHybridFormula(boolean hybrid)
void
setInfraGeneric(String infraGeneric)
void
setInfraSpecificEpithet(String infraSpecies)
void
setKey(Integer key)
void
setNomStatus(String nomStatus)
void
setNotho(NamePart notho)
void
setParsed(boolean parsed)
void
setParsedPartially(boolean parsedPartially)
void
setRank(Rank rank)
void
setRemarks(String remarks)
void
setScientificName(String scientificName)
void
setSensu(String sensu)
void
setSpecificEpithet(String species)
void
setStrain(String strain)
void
setType(NameType type)
void
setYear(String year)
String
toString()
-
-
-
Field Detail
-
HYBRID_MARKER
public static final Character HYBRID_MARKER
-
-
Constructor Detail
-
ParsedName
public ParsedName()
-
ParsedName
public ParsedName(NameType type, String genusOrAbove, String infraGeneric, String specificEpithet, String infraSpecificEpithet, NamePart notho, Rank rank, String authorship, String year, String bracketAuthorship, String bracketYear, String cultivarEpithet, String strain, String sensu, String nomStatus, String remarks)
-
-
Method Detail
-
getAuthorship
public String getAuthorship()
The original author of this name, e.g. basionym or recombination author
-
setAuthorship
public void setAuthorship(String authorship)
-
getBracketAuthorship
public String getBracketAuthorship()
The authorship of the original name, i.e. basionym, given in brackets.
-
setBracketAuthorship
public void setBracketAuthorship(String bracketAuthorship)
-
getBracketYear
public String getBracketYear()
The code relevant year of publication of the original name, i.e. basionym, given in brackets.
-
setBracketYear
public void setBracketYear(String bracketYear)
-
getCultivarEpithet
public String getCultivarEpithet()
The cultivar, cultivar group or grex part of a cultivated plant name. If given the name should be of type NameType.CULTIVAR
-
setCultivarEpithet
public void setCultivarEpithet(String cultivarEpithet)
-
getStrain
public String getStrain()
The strain or isolate name. Usually a capital collection code string followed by an accession number. See List of culture collection codes If given the name should be of type NameType.STRAIN
-
getGenusOrAbove
public String getGenusOrAbove()
The genus part of a bi/trinomial or the monomial in case of names of higher ranks
-
getInfraGeneric
public String getInfraGeneric()
The infrageneric part of a name, often given in parentheses between genus and species epithet, e.g. for a subgenus
-
getInfraSpecificEpithet
public String getInfraSpecificEpithet()
-
getNomStatus
public String getNomStatus()
Any nomenclatoral remarks given in this name, e.g. nom. illeg.
-
setNomStatus
public void setNomStatus(String nomStatus)
-
getNotho
public NamePart getNotho()
For hybrid names notho indicates which part of the name is considered a hybrid, i.e. genus, species or infraspecific epithet.
-
getRemarks
public String getRemarks()
Any further remarks found
-
setRemarks
public void setRemarks(String remarks)
-
getSensu
public String getSensu()
Taxon concept references as part of the name, e.g. "MSW2005" for Gorilla gorilla (Savage, 1847) sec. MSW2005
-
getSpecificEpithet
public String getSpecificEpithet()
-
getTerminalEpithet
public String getTerminalEpithet()
- Returns:
- the terminal epithet, infraspecific epithet if existing, the species epithet or null
-
getType
public NameType getType()
A coarse classification of names helping to deal with different syntactical name string structures.
-
hasAuthorship
public boolean hasAuthorship()
-
getScientificName
public String getScientificName()
The exact verbatim, full scientific name as given before parsing.
-
setScientificName
public void setScientificName(String scientificName)
-
isParsedPartially
public boolean isParsedPartially()
The GBIF name parser cannot always parse the entire name. This is often the case when taxonomic, nomenclatural or identification notes are added to the end of the name. In such cases when the name was only partially parsed (NameUsageIssue.PARTIALLY_PARSABLE) this flag should be true. If the name was not parsed at all this will be false.- Returns:
- true if name was only partially parsed, false otherwise
-
setParsedPartially
public void setParsedPartially(boolean parsedPartially)
-
isParsed
public boolean isParsed()
A flag indicating if a name could not be parsed at all. If false, only the scientific name, rank and potentially the name type is given.
-
setParsed
public void setParsed(boolean parsed)
-
authorshipComplete
public String authorshipComplete()
- Returns:
- The full concatenated authorship or null if it is a hybrid
-
buildName
public String buildName(boolean hybridMarker, boolean rankMarker, boolean authorship, boolean infrageneric, boolean genusForInfrageneric, boolean abbreviateGenus, boolean decomposition, boolean asciiOnly, boolean showIndet, boolean nomNote, boolean remarks, boolean showSensu, boolean showCultivar, boolean showStrain)
build a name controlling all available flags for name parts to be included in the resulting name.- Parameters:
hybridMarker
- include the hybrid marker with the name if existingrankMarker
- include the infraspecific or infrageneric rank marker with the name if existingauthorship
- include the names authorship (authorteam and year)infrageneric
- include the infrageneric name in brackets for species or infraspeciesgenusForInfrageneric
- include the genus name in front of an infrageneric name (not a species)abbreviateGenus
- if true abreviate the genus with its first characterdecomposition
- decompose unicode ligatures into their corresponding ascii ones, e.g. æ beomes aeasciiOnly
- transform unicode letters into their corresponding ascii ones, e.g. ø beomes o and ü ushowIndet
- if true include the rank marker for incomplete determinations, for example Puma spec.nomNote
- include nomenclatural notesremarks
- include informal remarks
-
canonicalName
public String canonicalName()
The canonical name sensu strictu with nothing else but 3 name parts at max (genus, species, infraspecific). No rank or hybrid markers and no authorship, cultivar or strain information. Infrageneric names are represented without a leading genus. Unicode characters will be replaced by their matching ASCII characters. For example: Abies alba Abies alba alpina Abies Bracteata Heucherella tiarelloides- Returns:
- the 1, 2 or 3 parted name as a single string
-
canonicalNameWithMarker
public String canonicalNameWithMarker()
The code-compliant, canonical name with three name parts at max (genus, species, infraspecific), a rank marker for infraspecific names and cultivar or strain epithets. The canonical name can be a 1, 2 or 3 parted name, but does not include any informal notes or authorships. Notho taxa will have the hybrid marker. Unicode characters will be replaced by their matching ASCII characters. For example: Abies alba Abies alba subsp. alpina Abies sect. Bracteata ×Heucherella tiarelloides- Returns:
- the 1,2 or 3 parted name as a single string
-
canonicalNameComplete
public String canonicalNameComplete()
The code-compliant, canonical name with rank and hybrid marker, authorship and cultivar or strain name included. Informal or nomenclatoral notes, concept references, subgenus and non-terminal authorships are removed.- Returns:
- the 1,2 or 3 parted name as a single string
-
canonicalSpeciesName
public String canonicalSpeciesName()
- Returns:
- the species binomial if this parsed name is a species or below. Or null in case its superspecific
-
getBracketYearInt
public Integer getBracketYearInt()
-
getYearInt
public Integer getYearInt()
-
isAutonym
public boolean isAutonym()
-
isBinomial
public boolean isBinomial()
-
isHybridFormula
public boolean isHybridFormula()
-
isIndetermined
public boolean isIndetermined()
- Returns:
- true for names with an infraspecifc rank but missing lowest name part. E.g. Coccyzuz americanus ssp. or Asteraceae spec. but not Maxillaria sect. Acaules
-
isParsableType
public boolean isParsableType()
-
isQualified
public boolean isQualified()
-
isRecombination
public boolean isRecombination()
- Returns:
- true if a bracket authorship is given, indicating that the name has been subsequently recombined.
-
setGenusOrAbove
public void setGenusOrAbove(String genusOrAbove)
-
setHybridFormula
public void setHybridFormula(boolean hybrid)
-
setInfraGeneric
public void setInfraGeneric(String infraGeneric)
-
setInfraSpecificEpithet
public void setInfraSpecificEpithet(String infraSpecies)
-
setSpecificEpithet
public void setSpecificEpithet(String species)
-
-