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