X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/e0e18e2b6f4b5e12f35aa80a41c77263221bd730..15a1666f8a1e19c338015fccd502be6cfd5c24df:/lib/Geocode.php diff --git a/lib/Geocode.php b/lib/Geocode.php index b07d1ade..57e9510f 100644 --- a/lib/Geocode.php +++ b/lib/Geocode.php @@ -2,12 +2,12 @@ namespace Nominatim; -require_once(CONST_BasePath.'/lib/PlaceLookup.php'); -require_once(CONST_BasePath.'/lib/Phrase.php'); -require_once(CONST_BasePath.'/lib/ReverseGeocode.php'); -require_once(CONST_BasePath.'/lib/SearchDescription.php'); -require_once(CONST_BasePath.'/lib/SearchContext.php'); -require_once(CONST_BasePath.'/lib/TokenList.php'); +require_once(CONST_LibDir.'/PlaceLookup.php'); +require_once(CONST_LibDir.'/Phrase.php'); +require_once(CONST_LibDir.'/ReverseGeocode.php'); +require_once(CONST_LibDir.'/SearchDescription.php'); +require_once(CONST_LibDir.'/SearchContext.php'); +require_once(CONST_LibDir.'/TokenList.php'); class Geocode { @@ -650,6 +650,8 @@ class Geocode $this->oNormalizer ); + $oCtx->setFullNameWords($oValidTokens->getFullWordIDs()); + // Try more interpretations for Tokens that could not be matched. foreach ($aTokens as $sToken) { if ($sToken[0] == ' ' && !$oValidTokens->contains($sToken)) { @@ -934,6 +936,8 @@ class Geocode } else { $aResult['foundorder'] += 0.01; } + // - rank + $aResult['foundorder'] -= 0.00001 * (30 - $aResult['rank_search']); // Adjust importance for the number of exact string matches in the result $iCountWords = 0;