Home > php教程 > php手册 > TP3.1.3中文分词

TP3.1.3中文分词

WBOY
Release: 2016-06-07 11:42:30
Original
1894 people have browsed it

TP3.1.3中文分词
http://www.thinkphp.cn/extend/435.html
分词类是使用上面的处理类
我的页是使用的是utf-8, 有些词分出是乱码.
我是这样处理的
Vendor ( 'SplitWord\lib_splitword_full' );
$sp = new SplitWord ();
$temp_str = $sp->SplitRMM ( trim ( $val ) );
$sp->Clear ();
if (mb_detect_encoding ( $temp_str, array (
'ASCII',
'UTF-8',
'GB2312',
'GBK',
'BIG5'
) ) !== 'UTF-8') {
$temp_str = iconv ( 'gbk', 'utf-8', $temp_str );
}

附件 SplitWord.rar ( 660.26 KB 下载:174 次 )

AD:真正免费,域名+虚机+企业邮箱=0元

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template