Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
bin
 
 
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

DwC Agent

Ruby 3.0 gem that cleanses messy Darwin Core terms like recordedBy or identifiedBy prior to passing to its dependent Namae gem, which executes the parsing. It also produces similarity scores between two given names.

Gem Version Gem Downloads Continuous Integration Status security

Usage

require "dwc_agent"
names = DwcAgent.parse '13267 (male) W.J. Cody; 13268 (female) W.E. Kemp'
=> [#<Name family="Cody" given="W.J.">, #<Name family="Kemp" given="W.E.">]

Parsing is occasionally messy & so it is advisable to make use of the additional clean method for each parsed name. However, the response is a Hash and not an object of type Namae::Name.

require "dwc_agent"
names = DwcAgent.parse 'Chaboo, Bennett, Shin'
=> [#<Name given="Chaboo">, #<Name given="Bennett">, #<Name given="Shin">]
DwcAgent.clean names[0]
=> {:title=>nil, :appellation=>nil, :given=>nil, :particle=>nil, :family=>"Chaboo", :suffix=>nil}
require "dwc_agent"
score = DwCAgent.similarity_score('John C.', 'John')
=> 1.1

Or, from the command-line:

gem install dwc_agent
dwcagent "13267 (male) W.J. Cody; 13268 (female) W.E. Kemp"
=> [{"title":null,"appellation":null,"given":"W.J.","particle":null,"family":"Cody","suffix":null},{"title":null,"appellation":null,"given":"W.E.","particle":null,"family":"Kemp","suffix":null}]
gem install dwc_agent
dwcagent-similarity "John C." "John"
=> 1.1

License

dwc_agent is released under the MIT license.

Support

Bug reports can be filed at https://github.com/bionomia/dwc_agent/issues.

Copyright

Authors: David P. Shorthouse

Copyright (c) 2018 Canadian Museum of Nature

About

Ruby gem to cleanse Darwin Core terms containing people names prior to passing to its dependent parser.

Resources

License

Releases

No releases published

Packages

No packages published

Languages