1. 你的词典只有“再试一个”这个词,当然就只有它了 2. scws_new/scws_free 是C 里的函数,在PHP中是 scws_open/scws_close 建议在PHP中用对象方式使用 scws 即 $so = scws_new(); $so->set_charset('gbk'); $so->set_dict(...
...f0000][scws] extension = scws.so[/color] [color=#808080]scws.default.charset = gbk scws.default.fpath = /usr/local/etc/scws[/color] [b][size=4][color=#154ba0]运行时配置[/color][/size][/b] scws.default.charset (default = gbk) , Changeable = PHP_INI_ALL scws.default.fpath (default = NU...
... 回车就出现这个 [XSErrorException] sdk/php/lib/XS.php(2205): stream_set_blocking() expects parameter 1 to be resource, null given(2) #0 [internal function]: xs_error_handler(2, 'stream_set_bloc...', '/home/wwwroot/x...', 2205, Array) #1 sdk/php/lib/XS.php(2205): stream_set_blocking(NULL, true...
... 回车就出现这个 [XSErrorException] sdk/php/lib/XS.php(2205): stream_set_blocking() expects parameter 1 to be resource, null given(2) #0 [internal function]: xs_error_handler(2, 'stream_set_bloc...', '/home/wwwroot/x...', 2205, Array) #1 sdk/php/lib/XS.php(2205): stream_set_blocking(NULL, true...
...[color=#DAA520]新增或变动的 API [/color]--[/size] 1. [libscws] scws_set_dict(scws_t s, const char *fpath, int mode); scws_add_dict(scws_t s, const char *fpath, int mode); scws_set_dict 为原有功能,scws_add_dict 是新增功能,2者功能相当接近,只是 scws_set_dict 会把...
代码如下 $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'...
...e] [b]配置项[/b] [code]// do the segment $cws = scws_new(); $cws->set_charset('utf8'); $cws->set_duality(false); $cws->set_ignore(false); $cws->set_multi(0); $limit=10; $xattr = '~v';[/code] [size=x-large][u][b]求解,不胜感激!![/b][/u][/size][hr] 好奇怪,我分出来...
...[XSErrorException] ../usr/local/xunsearch/sdk/php/lib/XS.php(2207): stream_set_blocking(): supplied argument is not a valid stream resource(2) #0 ../usr/local/xunsearch/sdk/php/lib/XS.php(2207): xs_error_handler(2, 'stream_set_bloc...', '/usr/local/xuns...', 2207, Array) #1 ../usr/local/xunsearch/...
HI,hightman $cws = new PSCWS4('utf8'); $cws->set_dict('etc/dict.utf8.xdb'); $cws->set_rule('etc/rules.utf8.ini'); $ret = array(); $ret = $cws->get_tops(10,'r,v,p'); echo "No.\tWord\t\t\tAttr\tTimes\tRank\n------------------------------------------------------\n"; $i = 1; foreach ($ret as $...
..._has_word(s,"*")) //"*"用NULL代替也不行 另外我用函数scws_set_ignore(s,1),怎么去不掉文本中的空格等特殊字符[hr] 我用的版本是scws-1.1.2