From: Bill Erickson Date: Wed, 17 Feb 2016 15:55:03 +0000 (-0500) Subject: JBAS-984 Address normalizer street => st X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=004a2f3a445d7c7a227a1091149c83088658acaf;p=working%2FEvergreen.git JBAS-984 Address normalizer street => st Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Utils/KCLSNormalize.pm b/Open-ILS/src/perlmods/lib/OpenILS/Utils/KCLSNormalize.pm index 65834b342b..7b12680daf 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Utils/KCLSNormalize.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Utils/KCLSNormalize.pm @@ -3,11 +3,15 @@ package OpenILS::Utils::KCLSNormalize; sub normalize_address_street { my ($street1, $street2) = @_; + $street1 = uc($street1) if $street1; + $street2 = uc($street2) if $street2; + # Replace 'AV' with 'AVE', but only when "AV" is surrounded by space # period, or end of line, so as not to clobber names that contain AV. if (my $s1 = $street1) { $s1 =~ s/\s+AV(\s|\.|$)+/ AVE /g; $s1 =~ s/\s+ST\.(\s|$)+/ ST /g; + $s1 =~ s/\s+STREET(\s|$)+/ ST /g; $s1 =~ s/(^\s*|\s*$)//g; # remove opening/trailing spaces $street1 = $s1; }