Uses component-based similarity: genus and epithet are matched separately,
then combined with weights (genus 0.6, species epithet 0.4; at subspecies
rank, genus 0.55, species epithet 0.30, and infraspecific epithet 0.15).
Uses base R utils::adist() for Levenshtein distance, with no extra
dependencies.
Usage
pr_fuzzy_match(
names_x,
names_y,
threshold = 0.9,
rank = "species",
quiet = FALSE,
identity_x = NULL,
identity_y = NULL
)Arguments
- names_x
Character vector.
- names_y
Character vector.
- threshold
Numeric (0–1). Minimum similarity score. Default 0.9.
- rank
Character.
"species"or"subspecies".- quiet
Logical. Suppress progress messages.
- identity_x
Internal authority identity evidence aligned to
names_x. Used only by the reconciliation cascade.- identity_y
Internal authority identity evidence aligned to
names_y. Used only by the reconciliation cascade.
Details
Candidate generation starts with names whose genus is within 2 edits.
When comparable authority identity is available, same-ID names in other
genera can also be considered. The existing pr_suggest_gender() helper
identifies its limited -us/-a/-um and -is/-e ending pairs. These pairs
are withheld without identity evidence and can match only when provider,
snapshot, rank, and accepted ID agree. The adjusted score treats the
supported species-epithet ending as equivalent; at subspecies rank, the
infraspecific epithet must also be sufficiently similar. This does not
establish grammar or identity.
Other fuzzy matches retain their spelling-based behavior.
The identity_x and identity_y arguments are internal evidence inputs
supplied by the reconciliation cascade. They are not part of the exported
user interface.