{"id":15555404,"url":"https://github.com/sckott/nameparser","last_synced_at":"2025-03-29T02:45:02.621Z","repository":{"id":140973600,"uuid":"26873619","full_name":"sckott/nameparser","owner":"sckott","description":"R port of Ruby's biodiversity scientific name parser","archived":false,"fork":false,"pushed_at":"2014-11-19T18:20:59.000Z","size":200,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T23:36:11.657Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sckott.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-19T17:46:47.000Z","updated_at":"2015-04-24T14:39:32.000Z","dependencies_parsed_at":"2023-03-12T17:45:15.450Z","dependency_job_id":null,"html_url":"https://github.com/sckott/nameparser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sckott%2Fnameparser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sckott%2Fnameparser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sckott%2Fnameparser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sckott%2Fnameparser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sckott","download_url":"https://codeload.github.com/sckott/nameparser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246131244,"owners_count":20728299,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T15:09:11.126Z","updated_at":"2025-03-29T02:45:02.600Z","avatar_url":"https://github.com/sckott.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"nameparser\n============\n\n`nameparser` parses taxonomic names. It's an R port of the Ruby gem `biodiversity`.\n\n\n## Installation\n\n```{r eval=FALSE}\ndevtools::install_github(\"sckott/nameparser\")\n```\n\n## Examples\n\nYou can use it as a library in Ruby, JRuby etc.\n\nto fix capitalization in canonicals\n\n```{r eval=FALSE}\nScientificNameParser.fix_case(\"QUERCUS (QUERCUS) ALBA\")\n# Output: Quercus (Quercus) alba\n```\n\nto parse a scientific name into a ruby hash\n\n```{r eval=FALSE}\nparser.parse(\"Plantago major\")\n```\n\nto get json representation\n\n```{r eval=FALSE}\nparser.parse(\"Plantago\").to_json\n#or\nparser.parse(\"Plantago\")\nparser.all_json\n```\n\nto clean name up\n\n```{r eval=FALSE}\nparser.parse(\"      Plantago       major    \")[:scientificName][:normalized]\n```\n\nto get only cleaned up latin part of the name\n\n```{r eval=FALSE}\nparser.parse(\"Pseudocercospora dendrobii (H.C. Burnett) U. \\\nBraun \u0026 Crous 2003\")[:scientificName][:canonical]\n```\n\nto get detailed information about elements of the name\n\n```{r eval=FALSE}\nparser.parse(\"Pseudocercospora dendrobii (H.C. Burnett 1883) U. \\\nBraun \u0026 Crous 2003\")[:scientificName][:details]\n```\n\nReturned result is not always linear, if name is complex. To get simple linear\nrepresentation of the name you can use:\n\n```{r eval=FALSE}\nparser.parse(\"Pseudocercospora dendrobii (H.C. Burnett) \\\nU. Braun \u0026 Crous 2003\")[:scientificName][:position]\n# returns {0=\u003e[\"genus\", 16], 17=\u003e[\"species\", 26],\n# 28=\u003e[\"author_word\", 32], 33=\u003e[\"author_word\", 40],\n# 42=\u003e[\"author_word\", 44], 45=\u003e[\"author_word\", 50],\n# 53=\u003e[\"author_word\", 58], 59=\u003e[\"year\", 63]}\n# where the key is the char index of the start of\n# a word, first element of the value is a semantic meaning\n# of the word, second element of the value is the character index\n# of end of the word\n```\n\n'Surrogate' is a broad group which includes 'Barcode of Life' names, and various\nundetermined names with cf. sp. spp. nr. in them:\n\n```{r eval=FALSE}\nparser.parse(\"Coleoptera BOLD:1234567\")[:scientificName][:surrogate]\n```\n\nTo parse using several CPUs (4 seem to be optimal)\n\n```{r eval=FALSE}\nparser = ParallelParser.new\n# ParallelParser.new(4) will try to run 4 processes if hardware allows\narray_of_names = [\"Betula alba\", \"Homo sapiens\"....]\nparser.parse(array_of_names)\n# Output: {\"Betula alba\" =\u003e {:scientificName...},\n# \"Homo sapiens\" =\u003e {:scientificName...}, ...}\n```\n\nparallel parser takes list of names and returns back a hash with names as\nkeys and parsed data as values\n\nTo get canonicals with ranks for infraspecific epithets:\n\n```{r eval=FALSE}\nparser = ScientificNameParser.new(canonical_with_rank: true)\nparser.parse('Cola cordifolia var. puberula \\\nA. Chev.')[:scientificName][:canonical]\n# Output: Cola cordifolia var. puberula\n```\n\nTo resolve lsid and get back RDF file\n\n```{r eval=FALSE}\nLsidResolver.resolve(\"urn:lsid:ubio.org:classificationbank:2232671\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsckott%2Fnameparser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsckott%2Fnameparser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsckott%2Fnameparser/lists"}