mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-07 10:34:08 +00:00
further increase penalty on housenumbers without numbers
Make the penality dependent on the length of the token: no penalty for one letter house numbers and increasing one for more letters.
This commit is contained in:
@@ -59,7 +59,7 @@ class HouseNumber
|
|||||||
$iSearchCost = 1;
|
$iSearchCost = 1;
|
||||||
if (preg_match('/\\d/', $this->sToken) === 0
|
if (preg_match('/\\d/', $this->sToken) === 0
|
||||||
|| preg_match_all('/[^0-9]/', $this->sToken, $aMatches) > 2) {
|
|| preg_match_all('/[^0-9]/', $this->sToken, $aMatches) > 2) {
|
||||||
$iSearchCost++;
|
$iSearchCost += strlen($this->sToken) - 1;
|
||||||
}
|
}
|
||||||
if (!$oSearch->hasOperator(\Nominatim\Operator::NONE)) {
|
if (!$oSearch->hasOperator(\Nominatim\Operator::NONE)) {
|
||||||
$iSearchCost++;
|
$iSearchCost++;
|
||||||
|
|||||||
Reference in New Issue
Block a user