JBAS-984 Address normalizer street => st
authorBill Erickson <berickxx@gmail.com>
Wed, 17 Feb 2016 15:55:03 +0000 (10:55 -0500)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Utils/KCLSNormalize.pm

index 65834b3..7b12680 100644 (file)
@@ -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;
     }