...clude #include main() { scws_t s; scws_res_t res, cur; char *text = "Hello, 我名字叫李那曲是一个中国人, 我有时买Q币来玩, 我还听说过C#语言"; if (!(s = scws_new())) { printf("error, can't init the scws_t!\n"); exit(-1); } scws_set_charset(s...
... ) [_terms:XSDocument:private] => [_texts:XSDocument:private] => [_charset:XSDocument:private] => UTF-8 [_meta:XSDocument:private] => Array ( [docid] => 9509 [rank] => 1 ...
...argv[]) { scws_t s; scws_res_t res, cur; char *text;// = "Hello, 我名字叫李那曲是一个中国人, 我有时买Q币来玩, 我还听说过C#语言"; text = "我是一名中国的程序员"; if(argc == 2) text = argv[1]; ...
# mydict_utf8.txt 我是新增词 爆红 再试一个 [php] $text = '最近撑腰体爆红网络我是新增词再试一个'; class scws { public $so; function get_microtime() { list($usec, $sec) = explode(' ', microtime()); return ((float)$usec + (float)$sec); } ...
...动试调用 ini 中指定路径下的词典和规则文件 $scws->send_text("这里没有调用 set_dict 和 set_rule 系统会自动试调用 ini"); $list = $scws->get_tops(3); settype($list, 'array'); foreach ($list as $tmp) { echo $tmp['word'].""; } $scws->...
...e.lo /usr/lib/gcc/i686-pc-cygwin/4.3.4/../../../libcygwin.a(libcmain.o):(.text+0xa9): undefined reference to `_WinMain@16' collect2: ld returned 1 exit status make[2]: *** [libscws.la] Error 1 make[2]: Leaving directory `/home/sundaming/scws-1.1.6/libscws' make[1]: *** [all-recursive] Error 1 ...
...code] #include #include main() { scws_t s; scws_res_t res, cur; char *text = "上海市"; if (!(s = scws_new())) { printf("error, can't init the scws_t!\n"); exit(-1); } scws_set_charset(s, "utf-8"); scws_set_dict(s, "/usr/local/etc/dict.utf8.xdb", SCWS_XDICT_XDB); scws_set_rule(s, "/...
[code] use Text::Scws; my $scws = Text::Scws->new; $scws->set_dict('dict.xdb'); $scws->set_rule('rule.ini'); $scws->set_ignore(1); $scws->set_multi(1); my $s = shift; $scws->send_text($s); while (my $r = $scws->get_result()) { foreach (@$r) { print $_->{word}, " "; } } ...
...ct($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.txt的内容为: # WORD TF IDF ATTR 再试一个 1.0 1.0 @ 可结果中并匹...
...nclude int main() { scws_t s; scws_res_t res, cur; char *text = "Hello, 我名字叫李那曲是一个中国人, 我有时买Q币来玩, 我还听说过C#语言"; int i; if (!(s = scws_new())) { printf("error, can't init the scws_t!\n"); ex...