这里你可以下载dedecms然后找到lib_splitword_full.php这个文件,或者到http://down.111cn.net下载分词包,按照下面的方法就可以正确的使用dedecms的分词系统了。
dedecms分词系统调用代码/*这里你可以下载dedecms然后找到lib_splitword_full.php教程这个文件,或者到http://down.111cn.net下载分词包,按照下面的方法就可以正确的使用dedecms的分词系统了。*/require("lib_splitword_full.php");
$str = "一线楼市交易清淡";
$t1 = exectime();
$sp = new splitword();
$t2 = exectime();
//$t0 = $t2-$t1;
//echo "载入时间: $t0 <br><br>";
echo $sp->findnewword($sp->splitrmm($str))."<hr>";echo $sp->splitrmm($str)."<hr>";
$sp->clear();
echo $str."<br>";
$t3 = exectime();$t0 = $t3-$t2;echo "<br>处理时间: $t0 <br><br>";
function exectime(){ $time = explode(" ", microtime());$usec = (double)$time[0]; $sec = (double)$time[1]; return $sec + $usec; }
绊脚石乃是进身之阶。