php分词用pscws4进行分词,但是分出来都是单个字
$test="你好哲理是世界国家地区的方向,路人甲路人乙还有喜好小孩";requiredirname(__FILE__).'/pscws4/pscws4.class.ph...
$test="你好哲理是世界国家地区的方向,路人甲路人乙还有喜好小孩";
require dirname(__FILE__).'/pscws4/pscws4.class.php';
$pscws=new PSCWS4();
$pscws->set_dict('/var/www/dict.utf8.xdb');
$pscws->set_rule(dirname(__FILE__).'/pscws4/etc/rules.utf8.ini');
$pscws->set_charset('utf8');
// $pscws->set_ignore(true);
$pscws->send_text($test);
while($some=$pscws->get_result())
{
foreach($some as $word)
{
echo "<pre>";
print_r($word);
echo "</pre>";
}
}
$pscws->close(); 展开
require dirname(__FILE__).'/pscws4/pscws4.class.php';
$pscws=new PSCWS4();
$pscws->set_dict('/var/www/dict.utf8.xdb');
$pscws->set_rule(dirname(__FILE__).'/pscws4/etc/rules.utf8.ini');
$pscws->set_charset('utf8');
// $pscws->set_ignore(true);
$pscws->send_text($test);
while($some=$pscws->get_result())
{
foreach($some as $word)
{
echo "<pre>";
print_r($word);
echo "</pre>";
}
}
$pscws->close(); 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询