X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/be61d055469ac955205b64351b1533647bd4ddca..37bf7bc20e2e3524b00514752f55ec9a3e7e01b4:/lib/lib.php diff --git a/lib/lib.php b/lib/lib.php index 96d2c048..cac95d84 100644 --- a/lib/lib.php +++ b/lib/lib.php @@ -169,7 +169,7 @@ { $aResult = array(array(join(' ',$aWords))); $sFirstToken = ''; - if ($iDepth < 8) { + if ($iDepth < 7) { while(sizeof($aWords) > 1) { $sWord = array_shift($aWords); @@ -785,20 +785,6 @@ } - function getWordSuggestions(&$oDB, $sWord) - { - $sWordQuoted = getDBQuoted(trim($sWord)); - $sSQL = "select *,levenshtein($sWordQuoted,word) from test_token "; - $sSQL .= "where (metaphone = dmetaphone($sWordQuoted) or metaphonealt = dmetaphone($sWordQuoted) or "; - $sSQL .= "metaphone = dmetaphone_alt($sWordQuoted) or metaphonealt = dmetaphone_alt($sWordQuoted)) "; - $sSQL .= "and len between length($sWordQuoted)-2 and length($sWordQuoted)+2 "; - $sSQL .= "and levenshtein($sWordQuoted,word) < 3 "; - $sSQL .= "order by levenshtein($sWordQuoted,word) asc, abs(len - length($sWordQuoted)) asc limit 20"; - $aSimilar = $oDB->getAll($sSQL); - return $aSimilar; - } - - function geocodeReverse($fLat, $fLon, $iZoom=18) { $oDB =& getDB();