forked from hans/Nominatim
sanity check of house number format
Add a penalty for house number search terms when they contain too many non-numeric characters in an attempt to filter tokens that ended up as house numbers in the word table as a result of mapping errors.
This commit is contained in:
@@ -890,6 +890,9 @@
|
||||
if ($aSearch['sHouseNumber'] === '')
|
||||
{
|
||||
$aSearch['sHouseNumber'] = $sToken;
|
||||
// sanity check: if the housenumber is not mainly made
|
||||
// up of numbers, add a penalty
|
||||
if (preg_match_all("/[^0-9]/", $sToken, $aMatches) > 2) $aSearch['iSearchRank']++;
|
||||
if ($aSearch['iSearchRank'] < $this->iMaxRank) $aNewWordsetSearches[] = $aSearch;
|
||||
/*
|
||||
// Fall back to not searching for this item (better than nothing)
|
||||
|
||||
Reference in New Issue
Block a user