gnames / gnparser

GNparser normalises scientific names and extracts their semantic elements.
MIT License
40 stars 5 forks source link

Adding nomenclatural code as a flag #267

Open gdower opened 1 week ago

gdower commented 1 week ago

As a GNParser user, it would be useful to indicate the nomenclatural code that gnparser should use. For example, in botanical mode GNParser would interpret and normalize scientific names and authorships according to IPNI's style.

Some examples IPNI vs the current GNparser normalized form:

IPNI: Glaphyropteris simulans (Ching) H.Ito in Nakai & Honda GNp: Glaphyropteris simulans (Ching) H. Ito ex Nakai & Honda

IPNI: Glaphyropteris (Fée) C.Presl ex Fée GNp: Glaphyropteris (Fee) C. Presl ex Fée

IPNI: Hemionitis pinnata Hook.f. GNp: Hemionitis pinnata Hook. fil.

IPNI: Dacrycarpus (Endl.) de Laub. GNp: Dacrycarpus subgen. Endl. de Laub.

So it would mainly be taking out the space with C. Presl as C.Presl, not normalizing filius to fil. (e.g., Hook. fil. as Hook.f.), fixing the ex/in issue, and handling genus combination authorships. I'm not sure why GNp normalizes Fée to Fee in the original authorship. For handling genus combination authorships, often I know the rank with high confidence and could provide that as a parameter like &rank=genus to help GNp interpret it correctly although that might only work when parsing 1 name at a time.

It might still be useful to have an independent flag for f. to fil. normalization. While IPNI uses the f. for filius, normalizing to fil. could still be useful in some cases to disambiguate from f. for forma.

dimus commented 1 week ago

@gdower I think it is a great idea to add an option for GNparser to consider names to parse belonging to a code. Currently e already have Cultivar flag, so we can add Botanical and Zoological flags to it