From 0c9a24148737d9934ab2da7ee865d5494d1810dc Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Fri, 6 Oct 2017 21:12:25 +0200 Subject: [PATCH] housenumbers may only appear before or after the name --- lib/Geocode.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Geocode.php b/lib/Geocode.php index bced2a36..d221e672 100644 --- a/lib/Geocode.php +++ b/lib/Geocode.php @@ -781,8 +781,8 @@ class Geocode // 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']++; - // also housenumbers should appear in the first or second phrase - if ($iPhrase > 1) $aSearch['iSearchRank'] += 1; + // also must not appear in the middle of the address + if ($aSearch['aAddress'] || $aSearch['aAddressNonSearch']) $aSearch['iSearchRank'] += 1; if ($aSearch['iSearchRank'] < $this->iMaxRank) $aNewWordsetSearches[] = $aSearch; /* // Fall back to not searching for this item (better than nothing)