]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/TokenWord.php
introduce classes for token list and token types
[nominatim.git] / lib / TokenWord.php
diff --git a/lib/TokenWord.php b/lib/TokenWord.php
new file mode 100644 (file)
index 0000000..92940c1
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+
+namespace Nominatim\Token;
+
+/**
+ * A standard word token.
+ */
+class Word
+{
+    public $iId;
+    // If true, the word may represent only part of a place name.
+    public $bPartial;
+    // Number of appearances in the database.
+    public $iSearchNameCount;
+
+    public function __construct($iId, $bPartial, $iSearchNameCount)
+    {
+        $this->iId = $iId;
+        $this->bPartial = $bPartial;
+        $this->iSearchNameCount = $iSearchNameCount;
+    }
+
+    public function debugInfo()
+    {
+        return array(
+                'ID' => $this->iId,
+                'Type' => 'word',
+                'Info' => array(
+                           'partial' => $this->bPartial,
+                           'count' => $this->iSearchNameCount
+                          )
+               );
+    }
+}