fukuball / jieba-php

"結巴"中文分詞:做最好的 PHP 中文分詞、中文斷詞組件。 / "Jieba" (Chinese for "to stutter") Chinese text segmentation: built to be the best PHP Chinese word segmentation module.

Home Page:http://jieba-php.fukuball.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

中文操作tip

acclea opened this issue · comments

在中文的操作过程中,遇到字符串的长度、截取等操作,如果直接使用 strlen、substr 等处理字符串,会在 VicWord.php 的 function getD(&$str, $i) 报错,由于中文的编码不同与英文,所以 需要用
mb_strlen、mb_substr 等,以 mb_开头的方法来处理字符串,不然会无法分词或者报错