make[2]: *** No rule to make target `rules_cht.utf8.ini', needed by `all-am'. Stop. make: *** [all] Error 2 报错,但是能用 [[i] 本帖最后由 Mistruster 于 2008-3-5 17:44 编辑 [/i]]
...scws = new PSCWS4(); $pscws->set_dict('scws/dict.utf8.xdb'); $pscws->set_rule('scws/rules.utf8.ini'); $pscws->set_ignore(true); $pscws->send_text($title); $words = $pscws->get_tops(10); $tags = array(); foreach ($words as $val) { $tags[] = $val['word']; } $pscws->close(); return $tags; }...
...s -> set_charset('utf-8'); $cws->set_dict('dict.utf8.xdb'); $cws->set_rule('pscws4/etc/rules.utf8.ini'); $cws->send_text($title); $words = $cws->get_tops(10); $cws->close(); $tags = array(); foreach ($words as $val) { $tags[] = $val['word']; } return implode(',', $tags); } ...
$so->set_dict('D:\php\scws\etc\dict.utf8.xdb'); $so->set_rule('D:\php\scws\etc\rules.utf8.ini'); $so->add_dict('D:\php\www\htdocs\dict_extra.txt', SCWS_XDICT_TXT); hm你好。 上边的代码的确可以自定义词库,现在的scws能否直接把词加入核心词库了啊?比如直接加...
...\DedeAMPZ\WebRoot\Default\tld\dede\getwen.php on line 6 Warning: scws_set_rule() [function.scws-set-rule]: open_basedir restriction in effect. File(C:\Program Files\scws\etc\rules.ini) is not within the allowed path(s): (D:/DedeAMPZ/WebRoot/Default) in D:\DedeAMPZ\WebRoot\Default\tld\dede\getwen.ph...
...'/usr/local/scws/etc/dict.utf8.xdb'); //设置分词所用规则 $so->set_rule('/usr/local/scws/etc/rules.utf8.ini'); //分词前去掉标点符号 $so->set_ignore(false); //是否复式分割,如“中国人”返回“中国+人+中国人”三个词。 $so->set_multi(false); //设...
...gnore('yes'); $pscws->set_dict('E:/scws/etc/dict.utf8.xdb'); $pscws->set_rule('E:/scws/etc/rules_cht.utf8.ini'); // 分词调用 send_text() 将待分词的字符串传入, 紧接着循环调用 get_result() 方法取回一系列分好的词 // 直到 get_result() 返回 false 为止 // 返...
...; /* }}} */ [/code] 编译后 在php代码中指定 dict字典和rule规则文件就可以了 $cws->set_dict('/usr/local/scws/etc/dict_chs_utf8.xdb'); $cws->set_rule('/usr/local/scws/etc/rules.utf8.ini');
... echo 'ok'; } else { echo 'no'; } $this -> so->set_rule('rules.utf8.ini'); } function word_list($text) { $time_start = $this -> get_microtime(); $this -> so->send_text($text); while ($temp = $this -> so->get_result()) { foreach ($temp as $key=>$val) ...