private $oNormalizer;
private $oTransliterator;
- private $aCountryRestriction;
public function __construct(&$oDB)
{
public function checkStatus()
{
- $sSQL = 'SELECT word_id FROM word limit 1';
+ $sSQL = 'SELECT word_id FROM word WHERE word_id is not null limit 1';
$iWordID = $this->oDB->getOne($sSQL);
if ($iWordID === false) {
- throw new Exception('Query failed', 703);
+ throw new \Exception('Query failed', 703);
}
if (!$iWordID) {
- throw new Exception('No value', 704);
+ throw new \Exception('No value', 704);
}
}
- public function setCountryRestriction($aCountries)
- {
- $this->aCountryRestriction = $aCountries;
- }
-
-
public function normalizeString($sTerm)
{
if ($this->oNormalizer === null) {
switch ($aWord['type']) {
case 'C': // country name tokens
- if ($aWord['word'] !== null
- && (!$this->aCountryRestriction
- || in_array($aWord['word'], $this->aCountryRestriction))
- ) {
+ if ($aWord['word'] !== null) {
$oValidTokens->addToken(
$sTok,
new Token\Country($iId, $aWord['word'])