2018-05-15 00:04:15 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Nominatim\Token;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A standard word token.
|
|
|
|
*/
|
|
|
|
class Word
|
|
|
|
{
|
2018-05-15 00:23:38 +03:00
|
|
|
/// Database word id, if applicable.
|
2018-05-15 00:04:15 +03:00
|
|
|
public $iId;
|
2018-05-15 00:23:38 +03:00
|
|
|
/// If true, the word may represent only part of a place name.
|
2018-05-15 00:04:15 +03:00
|
|
|
public $bPartial;
|
2018-05-15 00:23:38 +03:00
|
|
|
/// Number of appearances in the database.
|
2018-05-15 00:04:15 +03:00
|
|
|
public $iSearchNameCount;
|
2020-11-25 13:44:25 +03:00
|
|
|
/// Number of terms in the word.
|
|
|
|
public $iTermCount;
|
2018-05-15 00:04:15 +03:00
|
|
|
|
2020-11-25 13:44:25 +03:00
|
|
|
public function __construct($iId, $bPartial, $iSearchNameCount, $iTermCount)
|
2018-05-15 00:04:15 +03:00
|
|
|
{
|
|
|
|
$this->iId = $iId;
|
|
|
|
$this->bPartial = $bPartial;
|
|
|
|
$this->iSearchNameCount = $iSearchNameCount;
|
2020-11-25 13:44:25 +03:00
|
|
|
$this->iTermCount = $iTermCount;
|
2018-05-15 00:04:15 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
public function debugInfo()
|
|
|
|
{
|
|
|
|
return array(
|
|
|
|
'ID' => $this->iId,
|
|
|
|
'Type' => 'word',
|
|
|
|
'Info' => array(
|
|
|
|
'partial' => $this->bPartial,
|
|
|
|
'count' => $this->iSearchNameCount
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|