mirror of
https://github.com/osm-search/Nominatim.git
synced 2024-11-23 21:54:10 +03:00
housenumbers may only appear before or after the name
This commit is contained in:
parent
41d2cd318d
commit
0c9a241487
@ -781,8 +781,8 @@ class Geocode
|
|||||||
// sanity check: if the housenumber is not mainly made
|
// sanity check: if the housenumber is not mainly made
|
||||||
// up of numbers, add a penalty
|
// up of numbers, add a penalty
|
||||||
if (preg_match_all("/[^0-9]/", $sToken, $aMatches) > 2) $aSearch['iSearchRank']++;
|
if (preg_match_all("/[^0-9]/", $sToken, $aMatches) > 2) $aSearch['iSearchRank']++;
|
||||||
// also housenumbers should appear in the first or second phrase
|
// also must not appear in the middle of the address
|
||||||
if ($iPhrase > 1) $aSearch['iSearchRank'] += 1;
|
if ($aSearch['aAddress'] || $aSearch['aAddressNonSearch']) $aSearch['iSearchRank'] += 1;
|
||||||
if ($aSearch['iSearchRank'] < $this->iMaxRank) $aNewWordsetSearches[] = $aSearch;
|
if ($aSearch['iSearchRank'] < $this->iMaxRank) $aNewWordsetSearches[] = $aSearch;
|
||||||
/*
|
/*
|
||||||
// Fall back to not searching for this item (better than nothing)
|
// Fall back to not searching for this item (better than nothing)
|
||||||
|
Loading…
Reference in New Issue
Block a user