X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/6070c3d1d58fb8737b387e8a3ef1f17fb1eb5d54..5f09ba4e10b52b5154fb3e9211b8ec5fcfe82d91:/lib-php/TokenList.php?ds=sidebyside 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.')#'; } } }