...新的 1.1.4版本。 建议直接用对像操作方式,即 $scws = scws_new(); $scws->get_result(); 用对像操作方式就没有这个问题。 [/quote] 谢谢解答
...库,但好像英文及中英文混合分词都无效。 譬如: $so = scws_new(); $so->set_charset('utf8'); $so->set_dict('words.txt',SCWS_XDICT_TXT); $so->set_ignore(true); $so->send_text("GMhello指导员"); echo ''; while ($tmp = $so->get_result()) { var_dump($tmp); } $so->close(); 在words...
...ocal/bin/php-config checking for scws support... yes, shared checking for scws_new in -lscws... no configure: error: wrong scws lib version or lib not found 我的PHP为5.2.14,通过FreeBSD ports安装版本,,望解决。
...买Q币来玩, 我还听说过C#语言"; int i; if (!(s = scws_new())) { printf("error, can't init the scws_t!\n"); exit(-1); } scws_set_charset(s, "gbk"); scws_set_dict(s, "/usr/local/scws/etc/dict.xdb", SCWS_XDICT_XDB); ...
...国人, 我有时买Q币来玩, 我还听说过C#语言"; if (!(s = scws_new())) { printf("error, can't init the scws_t!\n"); exit(-1); } scws_set_charset(s, "gbk"); scws_set_dict(s, "/usr/local/scws/etc/dict.xdb", SCWS_XDICT_XDB); scws_set_rule(s, "/usr/local/scws/etc/rul...
... scws_t s; scws_top_t top, cur; char *text = "测试说明文字"; s = scws_new(); scws_set_charset(s, "utf8"); scws_set_dict(s, "/etc/dict.utf8.xdb", SCWS_XDICT_XDB); scws_send_text(s, text, strlen(text)); cur = top = scws_get_tops(s, 10, NULL); while (cur != NULL) { printf("WORD: %s, weight:%....
...5.3.x $mydata='阿斯顿发斯蒂芬罗铭罗大大罗' $cws = scws_new(); $cws->set_charset('utf8'); $cws->add_dict(XDB_PATH);//系统默认词库文件地址(xdb格式)[/quote] //$cws->add_dict(XDICT_PATH, SCWS_XDICT_TXT);//我的自定义词库地址 (...
代码如下 $so = scws_new(); $so->set_charset('utf-8'); // 这里没有调用 set_dict 和 set_rule 系统会自动试调用 ini 中指定路径下的词典和规则文件 $so->send_text("我是一个中国人");; while ($tmp = $so->get_result()) { foreach($tmp as $k=>$v){ echo $v['word'...
...scws_t s; scws_top_t top, cur; char *text = "测试说明文字"; s = scws_new(); scws_set_charset(s, "utf8"); scws_set_dict(s, "/etc/dict.utf8.xdb", SCWS_XDICT_XDB); scws_send_text(s, text, strlen(text)); cur = top = scws_get_tops(s, 10, NULL); while (cur != NULL) { printf("WORD: %s, ...
...float)$usec + (float)$sec); } function scws() { $this -> so = scws_new(); $this -> so->set_charset('utf8'); $this -> so->set_ignore(1); // $this -> so->add_dict('dict.utf8.xdb'); if($this -> so->add_dict('mydict_utf8.txt', SCWS_XDICT_TXT)) { echo 'ok'; } e...