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:
Sarah Hoffmann 2021-09-02 18:11:49 +02:00
parent d18794931a
commit 94d3dee369

View File

@ -59,7 +59,7 @@ class HouseNumber
$iSearchCost = 1;
if (preg_match('/\\d/', $this->sToken) === 0
|| preg_match_all('/[^0-9]/', $this->sToken, $aMatches) > 2) {
$iSearchCost++;
$iSearchCost += strlen($this->sToken) - 1;
}
if (!$oSearch->hasOperator(\Nominatim\Operator::NONE)) {
$iSearchCost++;