pub struct Informal {
pub taxon: String,
pub taxon_rank: Rank,
pub rank: Rank,
pub phrase: Option<String>,
pub code: Option<NomCode>,
}Expand description
An informal / semistructured name — the payload of crate::ParseResult::Informal, mirroring
Java org.gbif.nameparser.api.ParseResult.Informal.
A real supraspecific taxon (Self::taxon, a genus or higher uninomial) carrying a provisional,
non-code designation instead of a determined species epithet: a molecular provisional species
(Rhizobium sp. RMCC TR1811), a numbered placeholder (Allium sp. 1), or an informal group.
The 67.5M verbatim-corpus study found these are 5.5% of all real
names — 1 in 18 — hence a first-class representation.
Deliberately a FLAT type, not a reused ParsedName: the anchor lives in one place
(Self::taxon + Self::taxon_rank) and is never mislabelled as a backbone-validated
“genus”. Derived from an informal ParsedName at the crate::parse boundary. Only
names with NO species epithet land here; a binomial core (incl. cf./aff. and infraspecific-indet)
stays crate::ParseResult::Parsed so its specific_authorship is preserved.
Fields§
§taxon: StringThe supraspecific taxon it hangs off ("Rhizobium", "Ichneumonidae") — the parser’s best
guess, NOT validated against a taxonomic backbone.
taxon_rank: RankThat taxon’s rank — GENUS for the overwhelming Genus sp. majority (the anchor sits in the
genus slot); a bare supraspecific monomial carries its own rank. The parser’s best guess.
rank: RankThe rank the informal name purports to be — SPECIES for "sp.", UNRANKED for a group.
phrase: Option<String>The VERBATIM tail, from the rank marker to the end of the input ("sp. RMCC TR1811",
"sp. 1"); None only when there is no tail at all. An informal name is not fully
parsable by definition, so the tail is captured whole and nothing in it is interpreted —
it may therefore contain what looks like an author citation
("sp. Forster, 1968"), which is NOT separately parsed. That is deliberate: the parser
cannot reliably tell a citation from a specimen or culture code (43% of the tails the
pre-5.0.0 rule read as authorship were spurious — impossible years, collection acronyms
like ZRC/MNHN), and on the genuinely authored minority the citation belongs to the
Self::taxon anchor rather than to the undetermined species. taxon + " " + phrase
reproduces the input exactly.
code: Option<NomCode>The nomenclatural code when known, else None.
Implementations§
Source§impl Informal
impl Informal
Sourcepub fn canonical_name(&self) -> String
pub fn canonical_name(&self) -> String
The canonical string form of this informal name — e.g. "Rhizobium sp. RMCC TR1811",
"Ichneumonidae sp.", "Bartonella group". Mirrors Java NameFormatter.canonical(Informal):
it rebuilds the equivalent INFORMAL ParsedName — the Informal::taxon in the genus
slot, or the uninomial slot for a non-genus anchor — and renders it through
ParsedName::canonical_name_without_authorship, so the synthetic sp. marker and the
phrase land exactly where the parser would place them. Never empty: falls back to the bare
taxon should the rebuilt name render nothing. Named to parallel
ParsedName::canonical_name so bindings expose one method across both result variants.