... $words = array(); $text = $this->applySetting($text); $cmd = new XSCommand(XS_CMD_SEARCH_SCWS_GET, XS_CMD_SCWS_GET_TOPS, $limit, $text, $xattr); $res = self::$_server->execCommand($cmd, XS_CMD_OK_SCWS_TOPS); while ($res->buf !== '') { $tmp = unpack('Itimes/a4attr/a*word', $res...
... $this->_count !== null) { return $this->_count; } $cmd = new XSCommand(XS_CMD_SEARCH_GET_TOTAL, 0, $this->_defaultOp, $query); $res = $this->execCommand($cmd, XS_CMD_OK_SEARCH_TOTAL); $ret = unpack('Icount', $res->buf); if ($query === '') { $this->_count = $ret['count']...
...sWord($text, $xattr){ $text = $this->applySetting($text); $cmd = new XSCommand(XS_CMD_SEARCH_SCWS_GET, XS_CMD_SCWS_HAS_WORD, 0, $text, $xattr); $res = self::$_server->execCommand($cmd, XS_CMD_OK_INFO); return $res->buf === 'OK';} 判断是否包含指定词性的词
... $words = array(); $text = $this->applySetting($text); $cmd = new XSCommand(XS_CMD_SEARCH_SCWS_GET, XS_CMD_SCWS_GET_RESULT, 0, $text); $res = self::$_server->execCommand($cmd, XS_CMD_OK_SCWS_RESULT); while ($res->buf !== '') { $tmp = unpack('Ioff/a4attr/a*word', $res->buf); ...
...rms !== null) { $ret = $this->_terms; } else { $cmd = new XSCommand(XS_CMD_QUERY_GET_TERMS, 0, $this->_defaultOp, $query); $res = $this->execCommand($cmd, XS_CMD_OK_QUERY_TERMS); $ret = array(); $tmps = explode(' ', $res->buf); for ($i = 0; $i < count($tm...
...setting['add_dict'] = array(); } $this->_setting['add_dict'][] = new XSCommand(XS_CMD_SEARCH_SCWS_SET, XS_CMD_SCWS_ADD_DICT, $mode, $fpath); return $this;} 添加分词词典, 支持 TXT/XDB 格式
...nizer.class.php#L327 (显示) public function getVersion(){ $cmd = new XSCommand(XS_CMD_SEARCH_SCWS_GET, XS_CMD_SCWS_GET_VERSION); $res = self::$_server->execCommand($cmd, XS_CMD_OK_INFO); return $res->buf;} 获取 scws 版本号
...rval($synonym); if ($raw !== '' && $synonym !== '') { $cmd = new XSCommand(XS_CMD_INDEX_SYNONYMS, XS_CMD_INDEX_SYNONYMS_ADD, 0, $raw, $synonym); if ($this->_bufSize > 0) { $this->appendBuffer(strval($cmd)); } else { $this->execCommand($cmd, XS_CMD_OK_RQS...
...SCWS_XDICT_TXT : SCWS_XDICT_XDB; } $this->_setting['set_dict'] = new XSCommand(XS_CMD_SEARCH_SCWS_SET, XS_CMD_SCWS_SET_DICT, $mode, $fpath); unset($this->_setting['add_dict']); return $this;} 设置分词词典, 支持 TXT/XDB 格式
... === null ? '' : strval($synonym); if ($raw !== '') { $cmd = new XSCommand(XS_CMD_INDEX_SYNONYMS, XS_CMD_INDEX_SYNONYMS_DEL, 0, $raw, $synonym); if ($this->_bufSize > 0) { $this->appendBuffer(strval($cmd)); } else { $this->execCommand($cmd, XS_CMD_OK_RQS...