...。求过滤方案。 $sh = scws_open(); scws_set_charset($sh, 'utf8'); scws_set_dict($sh, './dict.txt', SCWS_XDICT_TXT); scws_set_rule($sh, './rules.ini');//文件内容为空 $cutword = $_POST['cutword']; scws_send_text($sh, $cutword); $rs = scws_get_tops($sh, 5); 另:我使用工具...
[quote='hightman' pid='3417' dateline='1259892522'] 从结果看应该是 scws_set_dict(s, "/usr/local/etc/dict_chs_gbk.xdb", SCWS_XDICT_MEM); 这句话出了问题, 也就是可能词典不正确. 但这个词典目前测试在64位系统下也是可以正常工作的, 检查一下词典的字...
...典 下面自定义字典出错。 系统:apache php5 [b]Warning[/b]: scws_set_dict() [[color=#0000ff]function.scws-set-dict[/color]]: Failed to load the dict file in [b]D:\AppServ\www\rootwww\fc\test.php[/b] on line [b]24[/b] [b]Warning[/b]: scws_set_rule() [[color=#0000ff]function.scws-set...
...用 scws_set_charset() $cws = scws_open(); scws_set_charset($cws, "gbk"); scws_set_dict($cws, "./etc/dict.xdb"); scws_add_dict($cws, "./etc/s.txt",SCWS_XDICT_TXT); scws_set_rule($cws, "./etc/rules.ini"); ---- 推荐采用类对像访问方式 $cws = scws_new("gbk"); $cws->set_dict('etc/dict.xdb');...
...我还有就是刚才我试了,我用我自定义的词生成词典,用scws_set_dict添加我的词典后(词典中的word TF IDF 都很高的,记性我标记为@),但输出(scws_get_tops)的有好多并不是我定义的词语,而且好多还把我定义的词组分解为多个,...
...hp_scws.c 2013-07-03 10:38:55.288772732 +0800 @@ -111,6 +111,7 @@ PHP_FE(scws_set_dict, NULL) PHP_FE(scws_set_rule, NULL) PHP_FE(scws_set_ignore, NULL) + PHP_FE(scws_use_rule, NULL) // shuying.lee adds it PHP_FE(scws_set_multi, NULL) PHP_FE(scws_set_duality, NULL) PHP_FE(scws_send_text,...
...t_charset($sh, 'gbk'); //scws_add_dict($sh, 'dict.txt', SCWS_XDICT_TXT); scws_set_dict($sh, 'dict.txt', SCWS_XDICT_TXT); //scws_set_rule($sh, 'rules.ini'); $text = "我发现个文字‘再试一个’"; scws_send_text($sh, $text); $top = scws_get_tops($sh, 5); print_r($top); [/php] dict....
...到php同目录下或者调用/usr/local/scws/etc/下的词库,都得到scws_set_dict(): supplied argument is not a valid scws handler resource。这是我php设置寻址有问题,还是scws_set_dict()调词库需要什么权限或特定路径。 问题3的分词结果是: Array ( ...
... 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/rules.ini"); for(i = 0; i < 1000000; i++){ scws_send_text(s, text, strlen(text)); while...
...nit 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/rules.ini"); scws_send_text(s, text, strlen(text)); while (res = cur = scws_get_result(s)) { while (cu...