Repository navigation
Keep hyphens in hyphenated names (#310) - #311
Conversation
strip_names() turned every hyphen into a space, so a hyphenated genus or epithet became two words and the binomial/trinomial keys matched the wrong names. A hyphen between two letters is now kept; others still go. Adds the issue's examples to the matcher benchmark and a dedicated test file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
How this was checkedAll against data version
Tests added
The
|
From an independent review: names written with a space where the reference has a hyphen (Ipomoea pes caprae) matched only by accident before and now aligned worse. match_taxa() now puts the hyphen back where the reference names use the word only hyphenated. A hyphen after a rank marker, qualifier or full stop (sp-Mt, var.-x, x-aneura) still separates words. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Independent review, and follow-up fix (e82eced)Copilot and Antigravity are out of quota, so a fresh Claude agent reviewed this PR, working from the code. I checked its findings against the code before acting on them. Confirmed regression, now fixed. The reviewer took all 848 hyphenated APC/APNI names and rewrote each with a space in place of the hyphen ( The fix (in
Re-measured on the reviewer's own inputs, comparing master with this branch:
What remains "worse", and why I left it:
Benchmark. The 239 existing rows are unchanged. 9 rows are added: the 5 issue examples, plus Tests.
Merge order. #309 also edits |
# Conflicts: # NEWS.md # R/load_taxonomic_resources.R # R/match_taxa.R
Acts on the maintainer decisions on the open questions in #309's first comment. - **`collapse_to_higher_taxon`: docs now describe the code.** `accepted_name` is `Genus sp.`, `suggested_name` is `Genus sp. [collapsed names: ...]`; `taxon_rank`, `taxon_ID` and `scientific_name` stay those of the most likely taxon. Output unchanged; a dead line that "demoted" the rank in a table column never joined back is removed. Pinned by new assertions. - **Old downloaded versions are not pruned** (decision recorded in AGENTS.md; location already documented). - **Benchmarks tightened.** The 118 rows that only asserted `suggested_name != updated_name` now assert the full expected `suggested_name`; each was checked against the target genus/family the row originally named. `test_splits_synonyms.csv` is now asserted (taxon_ID and status), with two rows updated for APC data changes. - **LICENSE** names Elizabeth Wenk, matching `cph` in DESCRIPTION. Merges cleanly with #311 and passes together. Details in the first comment. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Fixes #310.
strip_names()turned every punctuation mark into a space, hyphens included. A hyphenated genus (Van-royena) or epithet (plantago-aquatica) therefore became two words, every later word shifted along, and the binomial and trinomial match steps matched the wrong names:"Van-royena"aligned to the species Van-royena castanosperma, and"Acacia undulata-elegans var. …"to Acacia undulata var. elegans. A hyphen between two letters is now kept; hyphens next to digits or spaces (collector numbers,--intergrades) are still removed.The issue's five examples are added to the matcher benchmark and to a new test file. Measurements and checks are in the first comment.
🤖 Generated with Claude Code