...式的定义 $so->add_dict(ini_get("scws.default.fpath") . '/dict.utf8.xdb'); $so->set_rule(ini_get('scws.default.fpath') . '/rules.utf8.ini'); 那么就分词正常. 这个是第一个问题. 第二个问题就是,定义自定义的词典. 看到说1.1.2 支持自定义的 txt 字典....
... define('SCWS_MULTI_ZALL', 8); } if (!defined('SCWS_XDICT_XDB')) { define('SCWS_XDICT_XDB', 1); define('SCWS_XDICT_MEM', 2); define('SCWS_XDICT_TXT', 4); } } if ($arg !== null && $arg !== '') { $this->setMulti($arg); }} 构...
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 $...
$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能否直接把词加入核心词库了啊?比如直接加...
...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 (res = cur = scws_get_result(s)) ...
...n/mkdir -p "/usr/local/xunsearch/etc" /usr/bin/install -c -m 644 'etc/py.xdb' '/usr/local/xunsearch/etc/py.xdb' test -z "/usr/local/xunsearch/etc" || /bin/mkdir -p "/usr/local/xunsearch/etc" Ignore exists custom data file 'etc/dict_user.txt' Ignore exists custom data file 'etc/stopwords.txt' ...
... 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 (cur != NULL) { printf("Word: %.*s...
... scws_new(); scws_set_charset(s, "utf8"); scws_set_dict(s, "/etc/dict.utf8.xdb", SCWS_XDICT_XDB); scws_send_text(s, text, strlen(text)); cur = top = scws_get_tops(s, 10, NULL); while (cur != NULL) { printf("WORD: %s, weight:%.2f, times:%d, attr:%.2s\n", cur->word, cur->weight, cur->times, cur->att...
... = scws_new(); $cws->set_charset('utf8'); $cws->add_dict(XDB_PATH);//系统默认词库文件地址(xdb格式)[/quote] //$cws->add_dict(XDICT_PATH, SCWS_XDICT_TXT);//我的自定义词库地址 (txt格式) $cws->set_duality(true); $cws->set_ignore...
...ll charset.lo crc32.lo pool.lo scws.lo xdict.lo darray.lo rule.lo lock.lo xdb.lo xtree.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 ...