X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/fcf7fcee03c8d9a67e1ecace61df81aa81201936..0617768ee2f90bb5a5a73bb05b86d3c4bf6c074a:/lib/Phrase.php diff --git a/lib/Phrase.php b/lib/Phrase.php index b39079d9..7cf3f297 100644 --- a/lib/Phrase.php +++ b/lib/Phrase.php @@ -83,7 +83,7 @@ class Phrase $aResult = array(array(join(' ', $aWords))); $sFirstToken = ''; if ($iDepth < Phrase::MAX_DEPTH) { - while (sizeof($aWords) > 1) { + while (count($aWords) > 1) { $sWord = array_shift($aWords); $sFirstToken .= ($sFirstToken?' ':'').$sWord; $aRest = $this->createWordSets($aWords, $iDepth + 1); @@ -101,7 +101,7 @@ class Phrase $aResult = array(array(join(' ', $aWords))); $sFirstToken = ''; if ($iDepth < Phrase::MAX_DEPTH) { - while (sizeof($aWords) > 1) { + while (count($aWords) > 1) { $sWord = array_pop($aWords); $sFirstToken = $sWord.($sFirstToken?' ':'').$sFirstToken; $aRest = $this->createInverseWordSets($aWords, $iDepth + 1); @@ -113,4 +113,14 @@ class Phrase return $aResult; } + + public function debugInfo() + { + return array( + 'Type' => $this->sPhraseType, + 'Phrase' => $this->sPhrase, + 'Words' => $this->aWords, + 'WordSets' => $this->aWordSets + ); + } }