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

extractTags方法选项设置allowPOS后可能异常 #66

Closed bedlate closed 4 years ago

bedlate commented 4 years ago

未预先设置$words变量,导致程序异常。

foreach ($wordsPos as $key => $word) {
    if (in_array($word['tag'], $options['allowPOS'])) {
        $words[] = $word['word'];
    }
}
codecov-io commented 4 years ago

Codecov Report

Merging #66 into master will decrease coverage by 0.04%. The diff coverage is 50%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #66      +/-   ##
============================================
- Coverage     55.47%   55.42%   -0.05%     
- Complexity      268      270       +2     
============================================
  Files             5        5              
  Lines          1141     1142       +1     
============================================
  Hits            633      633              
- Misses          508      509       +1
Impacted Files Coverage Δ Complexity Δ
src/class/JiebaAnalyse.php 75.8% <50%> (-1.25%) 19 <0> (+2)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update d73898c...9e3037e. Read the comment docs.

fukuball commented 4 years ago

感謝!