X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/1147b83b22a073db2f81ea177f9caa12e727e249..a79ab417823dbb065d94a803633e31db2067cd0b:/lib-php/tokenizer/legacy_tokenizer.php 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);