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

自定义词对词性分词无效?

ChristianYeah opened this issue · comments

加载了自定义词后 Jieba::cut()没有问题 但是Posseg::cut() 无法分词

        Jieba::init();
        Jieba::loadUserDict('/Users/christian/Downloads/1.txt');
        Finalseg::init();
        Posseg::init();
        $words = Jieba::cut('luckin30');
        print_r($words);
        $words = Posseg::cut('luckin30');
        print_r($words);
        die();   
Array ( [0] => luckin [1] => 30 ) Array ( [0] => Array ( [word] => luckin30 [tag] => m ) )