]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/Phrase.php
small typos and wording in the API docs
[nominatim.git] / lib / Phrase.php
index 0fe1d3132ce6f8346fa7fdac77ced5379e877f3b..7cf3f29736d0f7cee944581b558a8bc2658d02cd 100644 (file)
@@ -9,7 +9,7 @@ namespace Nominatim;
  */
 class Phrase
 {
-    CONST MAX_DEPTH = 7;
+    const MAX_DEPTH = 7;
 
     // Complete phrase as a string.
     private $sPhrase;
@@ -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
+               );
+    }
+}