X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/044bb6afa53f2c799490d8a95ca050c8b755ca4c..77acc1c2be0c5fea487825a5e6a5a083e2b62569:/lib-php/TokenList.php diff --git a/lib-php/TokenList.php b/lib-php/TokenList.php index 2df9fe05..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]); } /** @@ -86,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(); } } } @@ -117,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.')#'; } } }