whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [whimsy] branch master updated: More suffices and prefixes
Date Mon, 30 Jul 2018 22:54:22 GMT
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 d9f482d  More suffices and prefixes
d9f482d is described below

commit d9f482d4b4e35b876e26a77e368086b043dbf394
Author: Sebb <sebb@apache.org>
AuthorDate: Mon Jul 30 23:54:21 2018 +0100

    More suffices and prefixes
---
 www/secretary/ldap-names.cgi | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/www/secretary/ldap-names.cgi b/www/secretary/ldap-names.cgi
index 891cd65..4e8575f 100755
--- a/www/secretary/ldap-names.cgi
+++ b/www/secretary/ldap-names.cgi
@@ -130,8 +130,8 @@ _html do
 
       new_given = '???'
       new_sn = '???'
-      names = p.cn.split(' ')
-      names.pop if %w(II III IV).include? names[-1] # drop numbers
+      names = p.cn.sub(/, (Jr\.|Ph\.D.)$/,'').split(' ')
+      names.pop if %w(II III IV Jr Jr.).include? names[-1] # drop numbers
       if names.size == 2
         new_given = names[0]
         new_sn = names[1]
@@ -141,7 +141,7 @@ _html do
           new_sn = names.join(' ')
         end
       elsif names.size == 3
-        if names[1] == 'van' or names[1] == 'de' or names[1] == 'le' or names[1] =~ /^[Dd]el$/
+        if %w(van Van de del Del le Le).include? names[1]
           new_given = names.shift
           new_sn = names.join(' ')
         elsif names[1] =~ /^[A-Z]\.$/ or names[1] =~ /^[A-NP-Z]$/ # James A. Taylor or Jon
B Goode (not Jack O Connor)


Mime
View raw message