You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2018/07/31 12:54:53 UTC
[whimsy] branch master updated: Make sure it works with additional
given names
This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new ddda67b Make sure it works with additional given names
ddda67b is described below
commit ddda67b89909bb8e9ccbdfa0fdc79af6e46e64c6
Author: Sebb <se...@apache.org>
AuthorDate: Tue Jul 31 13:54:52 2018 +0100
Make sure it works with additional given names
---
lib/whimsy/asf/person.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/whimsy/asf/person.rb b/lib/whimsy/asf/person.rb
index 88e3ac5..17d4195 100644
--- a/lib/whimsy/asf/person.rb
+++ b/lib/whimsy/asf/person.rb
@@ -91,7 +91,7 @@ module ASF
result['generationQualifier'] = words.pop if words.last =~ SUFFIXES
result['givenName'] = words.first # TODO does gn allow multiple words?
# extract surnames like van Gogh etc
- if words.size >= 4 and words[1..2] == %w(de la) or words[1..2] == %w(van der) or words[1..2] == %w(van de)
+ if words.size >= 4 and words[-3..-2] == %w(de la) or words[-3..-2] == %w(van der) or words[-3..-2] == %w(van de) or words[-3..-2] == %w(van den)
result['sn'] = words[-3..-1].join(' ')
elsif words.size >= 3 and %w(van Van de De del Del den le Le).include? words[-2]
result['sn'] = words[-2..-1].join(' ')