]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge remote-tracking branch 'upstream/master'
authorSarah Hoffmann <lonvia@denofr.de>
Thu, 1 May 2014 07:26:07 +0000 (09:26 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Thu, 1 May 2014 07:26:07 +0000 (09:26 +0200)
lib/Geocode.php

index 1588dff5def2bc99641b9facd890e62d3c69a791..32b50580e955e7e7c94e6edefbdafe81136c189d 100644 (file)
                                                                                                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)