]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib-php/TokenList.php
Merge pull request #3367 from lonvia/address-word-counts
[nominatim.git] / lib-php / TokenList.php
index bc8f9c3f1b06d9f24038342d7c8215f1b2dc3dea..9a3950a162c9cee85e519601e11c5e6f5f42212e 100644 (file)
@@ -1,4 +1,12 @@
 <?php
+/**
+ * SPDX-License-Identifier: GPL-2.0-only
+ *
+ * This file is part of Nominatim. (https://nominatim.org)
+ *
+ * Copyright (C) 2022 by the Nominatim developer community.
+ * For a full list of authors see the git log.
+ */
 
 namespace Nominatim;
 
@@ -79,7 +87,7 @@ class TokenList
         foreach ($this->aTokens as $aTokenList) {
             foreach ($aTokenList as $oToken) {
                 if (is_a($oToken, '\Nominatim\Token\Word')) {
-                    $ids[$oToken->iId] = $oToken->iId;
+                    $ids[$oToken->getId()] = $oToken->getId();
                 }
             }
         }
@@ -109,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.')#';
                 }
             }
         }