X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/fdff5791884da75cabe9e9393f1ac8a6021ab464..0fb8eade136ea03e7853aca0795ca69833c33661:/lib-php/tokenizer/legacy_icu_tokenizer.php diff --git a/lib-php/tokenizer/legacy_icu_tokenizer.php b/lib-php/tokenizer/legacy_icu_tokenizer.php index 3751e821..690ef136 100644 --- a/lib-php/tokenizer/legacy_icu_tokenizer.php +++ b/lib-php/tokenizer/legacy_icu_tokenizer.php @@ -8,7 +8,6 @@ class Tokenizer private $oNormalizer; private $oTransliterator; - private $aCountryRestriction; public function __construct(&$oDB) { @@ -19,7 +18,7 @@ class Tokenizer 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); @@ -30,12 +29,6 @@ class Tokenizer } - public function setCountryRestriction($aCountries) - { - $this->aCountryRestriction = $aCountries; - } - - public function normalizeString($sTerm) { if ($this->oNormalizer === null) { @@ -162,10 +155,7 @@ class Tokenizer 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'])