...ct(scws_t s, const char *fpath, int mode); int __declspec(dllexport) scws_set_dict(scws_t s, const char *fpath, int mode); void __declspec(dllexport) scws_set_charset(scws_t s, const char *cs); void __declspec(dllexport) scws_set_rule(scws_t s, const char *fpath); /* set ignore symbol or multi...
...s.c 2013-07-03 10:38:49.409846632 +0800 @@ -60,6 +60,9 @@ s->mblen = charset_table_get(NULL); s->off = s->len = 0; s->wend = -1; + + /* set default, shuying.lee adds it */ + scws_use_rule(s, 1); return s; } @@ -141,6 +144,16 @@ s->mode &= ~SCWS_IGN_SYMBOL; } +/* shuying.lee adds it...
... scws scws SCWS BugReport => http://www.ftphp.com/scws scws.default.charset => utf8 => utf8 scws.default.fpath => /usr/local/scws/etc => /usr/local/scws/etc [/php] 这是我代码: //分词 $so = scws_new(); $so->set_charset('utf8'); $rd = $so->set_dict('/usr/local/scws/etc/dict.utf8....
... scws_set_charset(s,"utf8"); scws_set_dict(s,argv[1],SCWS_XDICT_XDB); scws_set_rule(s,argv[2]); text = argv[3]; ...
void scws_set_multi(scws_t s, int mode); 描述:设定分词执行时是否执行针对长词复合切分。(例如:中国人->中国+人+中国人)。参数 mode 表示复合分词法的级别,取值为 1 ~ 15。mode 设定值,1~15。[b]按位与[/b]的 1|2|4|8 依次表示 短词|二...
[php] header("Content-type: text/html; charset=utf-8"); var_dump(SCWS('中文分词解析,我的个神啊')); //中文分词解析 function SCWS($title) { set_time_limit(0); $data = array("data"=>$title,"respond"=>"json","ignore"=>'yes', "multi"=>3); $data = http_build_query($data); $r...
...*** * @file xdb.h (read only) * @author Hightman Mar * @editor set number ; syntax on ; set autoindent ; set tabstop=4 (vim) ! * $Id: xdb.h,v 1.1.1.1 2007/06/05 04:19:45 hightman Exp $ */ #ifndef _SCWS_XDB_20070525_H_ --- 2,8 ---- * @file xdb.h (read only) * @author...
...文及中英文混合分词都无效。 譬如: $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.txt只定义如...
...加载的成功与失败。[/b][/i] 调用函数 scws_add_dict() ,scws_set_rule()来加载词库和规则集, 这两个函数在其内部都没有对是否加载成功做判断,所以无法根据scws_add_dict()的返回值来判断是否加载成功,而scws_set_rule()函数都没有返回...
...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/rules.ini"); for(i = 0; i < 1000000; i++){ scws_send_text(s, tex...