Skip to content

Commit

Permalink
word team in author name
Browse files Browse the repository at this point in the history
  • Loading branch information
mfenner committed Feb 2, 2024
1 parent 2734afe commit a543633
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
commonmeta-ruby (3.12.0)
commonmeta-ruby (3.12.1)
activesupport (>= 4.2.5, < 8.0)
addressable (~> 2.8.1, < 2.8.2)
base32-url (>= 0.7.0, < 1)
Expand Down
2 changes: 1 addition & 1 deletion lib/commonmeta/author_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def is_personal_name?(name: nil)
return false if name.to_s.split(" ").size == 1 && name.to_s.exclude?(",")

# check if name contains words known to be used in organization names
return false if %w[University College Institute School Center Department Laboratory Library Museum Foundation Society Association Company Corporation Collaboration Consortium Incorporated Inc. Institut Research Science].any? { |word| name.to_s.include?(word) }
return false if %w[University College Institute School Center Department Laboratory Library Museum Foundation Society Association Company Corporation Collaboration Consortium Incorporated Inc. Institut Research Science Team].any? { |word| name.to_s.include?(word) }

# check for suffixes, e.g. "John Smith, MD"
return true if name && %w[MD PhD].include?(name.split(", ").last)
Expand Down
2 changes: 1 addition & 1 deletion lib/commonmeta/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Commonmeta
VERSION = '3.12.0'
VERSION = '3.12.1'
end
5 changes: 5 additions & 0 deletions spec/author_utils_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@
author = { "name" => "Research Graph" }
expect(subject.is_personal_name?(name: author["name"])).to be false
end

it "name with ye another organization string" do
author = { "name" => "Team OA Brandenburg" }
expect(subject.is_personal_name?(name: author["name"])).to be false
end
end

context "cleanup_author" do
Expand Down

0 comments on commit a543633

Please sign in to comment.