X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/868caeaf1b9572ed0c1fc3b6728ce294e940d5e5..df008d99f549d850d07580b4592435388e44387c:/lib/Geocode.php diff --git a/lib/Geocode.php b/lib/Geocode.php index f2b99bdb..26fafb73 100644 --- a/lib/Geocode.php +++ b/lib/Geocode.php @@ -535,9 +535,9 @@ class Geocode // Conflicts between US state abreviations and various words for 'the' in different languages if (isset($this->aLangPrefOrder['name:en'])) { - $sQuery = preg_replace('/(^|,)\s*il\s*(,|$)/', '\1illinois\2', $sQuery); - $sQuery = preg_replace('/(^|,)\s*al\s*(,|$)/', '\1alabama\2', $sQuery); - $sQuery = preg_replace('/(^|,)\s*la\s*(,|$)/', '\1louisiana\2', $sQuery); + $sQuery = preg_replace('/(^|,)\s*il\s*(,|$)/i', '\1illinois\2', $sQuery); + $sQuery = preg_replace('/(^|,)\s*al\s*(,|$)/i', '\1alabama\2', $sQuery); + $sQuery = preg_replace('/(^|,)\s*la\s*(,|$)/i', '\1louisiana\2', $sQuery); } // Do we have anything that looks like a lat/lon pair? @@ -921,12 +921,12 @@ class Geocode $aResult['importance'] = 0.001; $aResult['foundorder'] = $aResult['addressimportance']; } else { - // Adjust importance for the number of exact string matches in the result + $aResult['importance'] = max(0.001, $aResult['importance']); $aResult['importance'] *= $this->viewboxImportanceFactor( $aResult['lon'], $aResult['lat'] ); - $aResult['importance'] = max(0.001, $aResult['importance']); + // Adjust importance for the number of exact string matches in the result $iCountWords = 0; $sAddress = $aResult['langaddress']; foreach ($aRecheckWords as $i => $sWord) {