X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/6a0361d0c6971026e10ee695b164fc2ae22b1f3a..62747c934d3445b000810f8a7737ea86777995e3:/lib/TokenList.php?ds=sidebyside diff --git a/lib/TokenList.php b/lib/TokenList.php index 96b756f8..67d94edd 100644 --- a/lib/TokenList.php +++ b/lib/TokenList.php @@ -32,6 +32,17 @@ class TokenList // List of list of tokens indexed by their word_token. private $aTokens = array(); + + /** + * Return total number of tokens. + * + * @return Integer + */ + public function count() + { + return count($this->aTokens); + } + /** * Check if there are tokens for the given token word. * @@ -114,7 +125,7 @@ class TokenList $iId, $aWord['class'], $aWord['type'], - $aWord['operator'] ? Operator::NONE : Operator::NEAR + $aWord['operator'] ? Operator::NEAR : Operator::NONE ); } } elseif ($aWord['country_code']) {