...应邀到美国与太空总署官员开会"; $pscws->send_text($text); while ($some = $pscws->get_result()) { foreach ($some as $word) { echo $word['word'].'=>'.$word['attr'].''; } flush(); } $pscws->close(); ?>[/php] 网页上的显示结果却是: 航天=>nr ...
... *************** *** 1397,1402 **** --- 1398,1405 ---- while (!cnt && (cur = cur->next) != NULL); scws_free_result(res); } + if (at != NULL) + free(at); s->off = off; return cnt; } *************** *** 1464,147...
..._TXT); $so->set_ignore(true); $so->send_text("GMhello指导员"); echo ''; while ($tmp = $so->get_result()) { var_dump($tmp); } $so->close(); 在words.txt只定义如下内容 GM 1.0 1.0 * hello指导员 1.0 1.0 * 而输出结果为: array(1) { [0]=> array(5) { ["word"]=> string(7) ...
...ho "Raw Query: " . $res->buf . "\n"; // get result documents while (true) { $res = $this->getRespond(); if ($res->cmd == XS_CMD_SEARCH_RESULT_FIELD) { $ret[] = XS::convert($res->buf, $this->_charset, 'UTF-8'); } elseif ($res->cmd == XS_CM...
...lect id,title,time,sid,content,key from learn limit 4429 offset 3000"); while($r=mysql_fetch_array($result)){ $a["id"]=$r['id']; $a["title"]=$r['title']; $a["time"]=$r['time']; $a["sid"]=$r['sid']; $a["content"]=$r['content']; $a["key"]=$r['key']; $doc->setFields($a); $index->update($doc)...
...scws_free_tops(scws_top_t tops) { scws_top_t cur; int len; int b; while ((cur = tops) != NULL) { tops = cur->next; if (cur->word) { OutputDebugStringA(cur->word);//能正常输出能容 len = strlen(cur->word);//长度都正确 b = ('\0'==cur->word[len+1]);//大部分...
...ction getDataList(){ // read line (check to timeout?) $line = ''; while (true) { $buf = fgets($this->fd, 8192); if ($buf === false || strlen($buf) === 0) { break; } $line .= $buf; if (strlen($buf) < 8191 || substr($buf, - 1, 1) === "\n") { ...
...ee_plist plist = _xdb_tree_plist,tmp_plist = _xdb_tree_plist; while (tmp_plist != NULL) { plist = tmp_plist; tmp_plist = tmp_plist->next; } plist->next = list; } //left right memcpy(ptr, buf,...
..._send_text(s, text, strlen(text)); cur = top = scws_get_tops(s, 10, NULL); while (cur != NULL) { printf("WORD: %s, weight:%.2f, times:%d, attr:%.2s\n", cur->word, cur->weight, cur->times, cur->attr); cur = cur->next; } scws_free_tops(top); scws_free(s);
...径下的词典和规则文件 $so->send_text("我是一个中国人");; while ($tmp = $so->get_result()) { foreach($tmp as $k=>$v){ echo $v['word']."|"; } print_r($tmp); } $so->close(); 我用的版本是:php_scws.dll(2) PHP扩展库 Windows/PHP 5.2.x 准确: 95%, 召回: 91%, 速度:...