Treat a Polish l as an ASCII l in full-text search
authorDan Scott <dan@coffeecode.net>
Mon, 30 May 2011 03:36:44 +0000 (23:36 -0400)
committerDan Scott <dscott@laurentian.ca>
Tue, 31 Jul 2012 17:24:32 +0000 (13:24 -0400)
Is this code path even hit these days? Would have expected
naco_normalize to be poking around here if that was the case...

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/fts.pm

index 2857e2a..a07196b 100644 (file)
@@ -24,6 +24,9 @@
                $term =~ s/(\pM+)//gos;
                $term =~ s/(\b\.\b)//gos;
 
+               $term =~ s/\x{142}/l/sgo; # Convert Polish l (lowercase)
+               $term =~ s/\x{141}/l/sgo; # Convert Polish l (uppercase)
+
                # hack to normalize ratio-like strings
                while ($term =~ /\b\d{1}:[, ]?\d+(?:[ ,]\d+[^:])+/o) {
                        $term = $` . join ('', split(/[, ]/, $&)) . $';