X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/6070c3d1d58fb8737b387e8a3ef1f17fb1eb5d54..c55c3657c32e1c11f0aa7811b6720d4a711f9abb:/lib-php/TokenList.php diff --git a/lib-php/TokenList.php b/lib-php/TokenList.php index f310306d..9a3950a1 100644 --- a/lib-php/TokenList.php +++ b/lib-php/TokenList.php @@ -1,4 +1,12 @@ aTokens[$sWord]) || isset($this->aTokens[' '.$sWord]); + return isset($this->aTokens[$sWord]); } /** @@ -87,8 +86,8 @@ class TokenList foreach ($this->aTokens as $aTokenList) { foreach ($aTokenList as $oToken) { - if (is_a($oToken, '\Nominatim\Token\Word') && !$oToken->bPartial) { - $ids[$oToken->iId] = $oToken->iId; + if (is_a($oToken, '\Nominatim\Token\Word')) { + $ids[$oToken->getId()] = $oToken->getId(); } } } @@ -118,9 +117,9 @@ class TokenList $aWordsIDs = array(); foreach ($this->aTokens as $sToken => $aWords) { foreach ($aWords as $aToken) { - if ($aToken->iId !== null) { - $aWordsIDs[$aToken->iId] = - '#'.$sToken.'('.$aToken->iId.')#'; + $iId = $aToken->getId(); + if ($iId !== null) { + $aWordsIDs[$iId] = '#'.$sToken.'('.$aToken->debugCode().' '.$iId.')#'; } } }