// 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.
*
$iId,
$aWord['class'],
$aWord['type'],
- $aWord['operator'] ? Operator::NONE : Operator::NEAR
+ $aWord['operator'] ? Operator::NEAR : Operator::NONE
);
}
} elseif ($aWord['country_code']) {
} else {
$oToken = new Token\Word(
$iId,
- $aWord['word'][0] != ' ',
+ $aWord['word_token'][0] != ' ',
(int) $aWord['count']
);
}