mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-12 05:44:06 +00:00
consider possibility that values with number in near start of search might be a house number (even if we have never seen them before). Also add better label for building:yes
This commit is contained in:
@@ -278,7 +278,7 @@
|
||||
{
|
||||
unset($aPhrases[$iPhrase]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// reindex phrases - we make assumptions later on
|
||||
$aPhrases = array_values($aPhrases);
|
||||
@@ -366,6 +366,16 @@
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
foreach($aTokens as $sToken)
|
||||
{
|
||||
// Unknown single word token with a number - assume it is a house number
|
||||
if (!isset($aValidTokens[' '.$sToken]) && strpos($sToken,' ') === false && preg_match('/[0-9]/', $sToken))
|
||||
{
|
||||
$aValidTokens[' '.$sToken] = array('class'=>'place','type'=>'house');
|
||||
}
|
||||
}
|
||||
|
||||
// Any words that have failed completely?
|
||||
// TODO: suggestions
|
||||
|
||||
@@ -1094,6 +1104,12 @@
|
||||
$aResult['icon'] = CONST_Website_BaseURL.'images/mapicons/'.$aClassType[$aResult['class'].':'.$aResult['type']]['icon'].'.p.20.png';
|
||||
}
|
||||
|
||||
if (isset($aClassType[$aResult['class'].':'.$aResult['type']]['label'])
|
||||
&& $aClassType[$aResult['class'].':'.$aResult['type']]['label'])
|
||||
{
|
||||
$aResult['label'] = $aClassType[$aResult['class'].':'.$aResult['type']]['label'];
|
||||
}
|
||||
|
||||
if ($bShowAddressDetails)
|
||||
{
|
||||
$aResult['address'] = getAddressDetails($oDB, $sLanguagePrefArraySQL, $aResult['place_id'], $aResult['country_code']);
|
||||
|
||||
Reference in New Issue
Block a user