fukuball / jieba-php

"結巴"中文分詞:做最好的 PHP 中文分詞、中文斷詞組件。 / "Jieba" (Chinese for "to stutter") Chinese text segmentation: built to be the best PHP Chinese word segmentation module.
http://jieba-php.fukuball.com
MIT License
1.32k stars 260 forks source link

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

Closed ChristianYeah closed 5 years ago

ChristianYeah commented 5 years ago

加载了自定义词后 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 ) )