Skip to content

Commit

Permalink
Remove 'unknown or anonymous'
Browse files Browse the repository at this point in the history
  • Loading branch information
dshorthouse committed Oct 24, 2023
1 parent 39b7978 commit 994f742
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dwc_agent.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Gem::Specification.new do |s|
s.name = 'dwc_agent'
s.version = DwcAgent::Version.version
s.license = 'MIT'
s.date = '2023-10-12'
s.date = '2023-10-23'
s.summary = "Parse Darwin Core agent terms such as recordedBy and identifiedBy"
s.description = "Parses the typically messy content in Darwin Core terms that contain people names"
s.authors = ["David P. Shorthouse"]
Expand Down
1 change: 1 addition & 0 deletions lib/dwc_agent/constants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module DwcAgent
\b[,;]?\s*(?i:exp)\.?\s*(\b|\z)|
\b[,;]?\s*(?i:aboard)[^$]+|
\b[,;]?\s+(?i:on)\b|
\b(?i:unknown\s+or\s+anonymous)|
\b[,;]?\s*(?i:unkn?own)\b|
\b[,;]?\s*(?i:n/a)\b|
\b[,;]?\s*(?i:ann?onymous)\b|
Expand Down
2 changes: 1 addition & 1 deletion lib/dwc_agent/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Version

MAJOR = 3
MINOR = 0
PATCH = 15
PATCH = 16
BUILD = 0

def self.version
Expand Down
6 changes: 6 additions & 0 deletions spec/dwc_agent/parser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2087,5 +2087,11 @@ module DwcAgent
expect(parsed[0].values_at(:given, :family)).to eq(["Lucile", "Capt"])
end

it "should strip out 'UNKNOWN OR ANONYMOUS'" do
input = "UNKNOWN OR ANONYMOUS"
parsed = parser.parse(input)
expect(parsed.size).to eq(0)
end

end
end

0 comments on commit 994f742

Please sign in to comment.