]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/Phrase.php
README: tiny markdown syntax error
[nominatim.git] / lib / Phrase.php
index b39079d94eafc38ddf11f08a1d2732053d5fd455..7cf3f29736d0f7cee944581b558a8bc2658d02cd 100644 (file)
@@ -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
+               );
+    }
 }