]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib-php/tokenizer/legacy_tokenizer.php
add tests for sanitizer tagging language
[nominatim.git] / lib-php / tokenizer / legacy_tokenizer.php
index e5ffbe025f05aabb268b886bc6c055174eb831e5..b508d220aca3f07e861fd0bbb6efc39a13cf5528 100644 (file)
@@ -87,6 +87,23 @@ class Tokenizer
             $sNormQuery .= ','.$this->normalizeString($oPhrase->getPhrase());
             $sSQL .= 'make_standard_name(:' .$iPhrase.') as p'.$iPhrase.',';
             $aParams[':'.$iPhrase] = $oPhrase->getPhrase();
+
+            // Conflicts between US state abbreviations and various words
+            // for 'the' in different languages
+            switch (strtolower($oPhrase->getPhrase())) {
+                case 'il':
+                    $aParams[':'.$iPhrase] = 'illinois';
+                    break;
+                case 'al':
+                    $aParams[':'.$iPhrase] = 'alabama';
+                    break;
+                case 'la':
+                    $aParams[':'.$iPhrase] = 'louisiana';
+                    break;
+                default:
+                    $aParams[':'.$iPhrase] = $oPhrase->getPhrase();
+                    break;
+            }
         }
         $sSQL = substr($sSQL, 0, -1);