]> git.openstreetmap.org Git - nominatim.git/blob - lib-php/TokenWord.php
Merge pull request #2164 from lonvia/add-make-install
[nominatim.git] / lib-php / TokenWord.php
1 <?php
2
3 namespace Nominatim\Token;
4
5 /**
6  * A standard word token.
7  */
8 class Word
9 {
10     /// Database word id, if applicable.
11     public $iId;
12     /// If true, the word may represent only part of a place name.
13     public $bPartial;
14     /// Number of appearances in the database.
15     public $iSearchNameCount;
16     /// Number of terms in the word.
17     public $iTermCount;
18
19     public function __construct($iId, $bPartial, $iSearchNameCount, $iTermCount)
20     {
21         $this->iId = $iId;
22         $this->bPartial = $bPartial;
23         $this->iSearchNameCount = $iSearchNameCount;
24         $this->iTermCount = $iTermCount;
25     }
26
27     public function debugInfo()
28     {
29         return array(
30                 'ID' => $this->iId,
31                 'Type' => 'word',
32                 'Info' => array(
33                            'partial' => $this->bPartial,
34                            'count' => $this->iSearchNameCount
35                           )
36                );
37     }
38 }