X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/4ae5ba7fc4a3451c806d89a583158412ea26bd01..90b29aa8080ffae08084cf556b45e05f9f2d3198:/lib-php/tokenizer/legacy_tokenizer.php?ds=inline diff --git a/lib-php/tokenizer/legacy_tokenizer.php b/lib-php/tokenizer/legacy_tokenizer.php index e5ffbe02..6f3d2304 100644 --- a/lib-php/tokenizer/legacy_tokenizer.php +++ b/lib-php/tokenizer/legacy_tokenizer.php @@ -1,4 +1,12 @@ oDB->getCol($sSQL); + } + + public function tokensForSpecialTerm($sTerm) { $aResults = array(); @@ -87,6 +103,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);