mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
move special hack for US states to legacy tokenizer
The hack for IL, AL and LA is only needed because these abbreviations are removed by the legacy tokenizer as a stop word. There is no need to keep the hack for future tokenizers. Move it therefore to the token extraction function.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user