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

修正分詞字典檔路徑錯誤以及使用者自定義字典詞性讀取問題 #15

Closed GrayChu closed 8 years ago

GrayChu commented 8 years ago

修正上述問題, 載入自定義字典的時候一定要先Jieba::loadUserDict再Posseg::init();

coveralls commented 8 years ago

Coverage Status

Coverage decreased (-3.7%) to 89.155% when pulling dda1084b00764ffa8a0e535c1633d22f1156d77e on GrayChu:master into 8fd96be91d7b1c3539878162363f9e9963ca7b6d on fukuball:master.

fukuball commented 8 years ago

@GrayChu 單元測試沒有過,應該是載入客製字典的功能沒有檢查未指定客製字典的例外,可以幫忙加上例外檢查嗎?謝謝~

詳細情況請查閱:https://travis-ci.org/fukuball/jieba-php/builds/162167796

coveralls commented 8 years ago

Coverage Status

Coverage decreased (-2.9%) to 89.93% when pulling 99c1716e153f96f103953953a6ac124d5ec72fde on GrayChu:master into 8fd96be91d7b1c3539878162363f9e9963ca7b6d on fukuball:master.

coveralls commented 8 years ago

Coverage Status

Coverage decreased (-1.8%) to 91.074% when pulling b40ba7f42d9ba27de6093e6cee4a337b7f4ec17b on GrayChu:master into 8fd96be91d7b1c3539878162363f9e9963ca7b6d on fukuball:master.

fukuball commented 8 years ago

@GrayChu 酷~ 不過需要再請你幫忙修正一個地方,由於目前 Coding Style 是遵循 PSR2 標準,所以目前跑測試還是沒有過,你可以在你的 Project 根目錄執行 vendor/bin/phpcs --standard=PSR2 --extensions=php --ignore=*/test/* ./src/class 這個指令,看看怎麼修正不符合標準的地方。

例如:PSR2 建議使用 elseif 而非 else if 相關討論:http://stackoverflow.com/questions/3662412/are-elseif-and-else-if-completely-synonymous

目前不符合標準需要修正的地方如下圖: 2016-10-04 13 30 57 也可參考 Travis-CI 做修正

coveralls commented 8 years ago

Coverage Status

Coverage decreased (-1.7%) to 91.111% when pulling b2a3d77014ac9ae5be672a83101cb5018f556042 on GrayChu:master into 8fd96be91d7b1c3539878162363f9e9963ca7b6d on fukuball:master.

GrayChu commented 8 years ago

謝謝你的意見~~~我再試試看

coveralls commented 8 years ago

Coverage Status

Coverage decreased (-1.8%) to 91.086% when pulling d6f62ffb92783afb1bef321ed077b9135432f356 on GrayChu:master into 8fd96be91d7b1c3539878162363f9e9963ca7b6d on fukuball:master.

coveralls commented 8 years ago

Coverage Status

Coverage decreased (-1.8%) to 91.086% when pulling 48d36101e3c56fa8492cd2a4c645943be304da17 on GrayChu:master into 8fd96be91d7b1c3539878162363f9e9963ca7b6d on fukuball:master.

codecov-io commented 8 years ago

Current coverage is 91.25% (diff: 55.17%)

Merging #15 into master will decrease coverage by 1.69%

@@             master        #15   diff @@
==========================================
  Files             4          4          
  Lines           723        743    +20   
  Methods          25         25          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits            672        678     +6   
- Misses           51         65    +14   
  Partials          0          0          

Powered by Codecov. Last update 8fd96be...48d3610

fukuball commented 8 years ago

@GrayChu 感覺應該可以了,謝啦!