namespace Nominatim;
-require_once(CONST_BasePath.'/lib/TokenCountry.php');
-require_once(CONST_BasePath.'/lib/TokenHousenumber.php');
-require_once(CONST_BasePath.'/lib/TokenPostcode.php');
-require_once(CONST_BasePath.'/lib/TokenSpecialTerm.php');
-require_once(CONST_BasePath.'/lib/TokenWord.php');
-require_once(CONST_BasePath.'/lib/SpecialSearchOperator.php');
+require_once(CONST_LibDir.'/TokenCountry.php');
+require_once(CONST_LibDir.'/TokenHousenumber.php');
+require_once(CONST_LibDir.'/TokenPostcode.php');
+require_once(CONST_LibDir.'/TokenSpecialTerm.php');
+require_once(CONST_LibDir.'/TokenWord.php');
+require_once(CONST_LibDir.'/SpecialSearchOperator.php');
/**
* Saves information about the tokens that appear in a search query.
return isset($this->aTokens[$sWord]) ? $this->aTokens[$sWord] : array();
}
+ public function getFullWordIDs()
+ {
+ $ids = array();
+
+ foreach ($this->aTokens as $aTokenList) {
+ foreach ($aTokenList as $oToken) {
+ if (is_a($oToken, '\Nominatim\Token\Word') && !$oToken->bPartial) {
+ $ids[$oToken->iId] = $oToken->iId;
+ }
+ }
+ }
+
+ return $ids;
+ }
+
/**
* Add token information from the word table in the database.
*
$oToken = new Token\Word(
$iId,
$aWord['word_token'][0] != ' ',
- (int) $aWord['count']
+ (int) $aWord['count'],
+ substr_count($aWord['word_token'], ' ')
);
}