X-Git-Url: https://git.openstreetmap.org/nominatim.git/blobdiff_plain/cdf8c678988cdad7d10cc52b5ece22196c2491f9..9e35e5c2b02887e361972ffbb20e65bbba0d02c7:/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 + ); + } }