adapt special terms lookup to new word table

This commit is contained in:
Sarah Hoffmann
2021-07-21 10:52:34 +02:00
parent 70f154be8b
commit 6ad35aca4a

View File

@@ -19,7 +19,7 @@ class Tokenizer
public function checkStatus() public function checkStatus()
{ {
$sSQL = "SELECT word_id FROM word WHERE word_token IN (' a')"; $sSQL = "SELECT word_id FROM word WHERE word_token == 'a'";
$iWordID = $this->oDB->getOne($sSQL); $iWordID = $this->oDB->getOne($sSQL);
if ($iWordID === false) { if ($iWordID === false) {
throw new Exception('Query failed', 703); throw new Exception('Query failed', 703);
@@ -55,9 +55,8 @@ class Tokenizer
{ {
$aResults = array(); $aResults = array();
$sSQL = 'SELECT word_id, class, type FROM word '; $sSQL = "SELECT word_id, info->>'class' as class, info->>'type' as type ";
$sSQL .= ' WHERE word_token = \' \' || :term'; $sSQL .= ' FROM word WHERE word_token = :term and type = \'S\'';
$sSQL .= ' AND class is not null AND class not in (\'place\')';
Debug::printVar('Term', $sTerm); Debug::printVar('Term', $sTerm);
Debug::printSQL($sSQL); Debug::printSQL($sSQL);