chenlb / mmseg4j-solr

mmseg4j for lucene or solr analyzer
Apache License 2.0
398 stars 141 forks source link

Why defaultDicPath not exist? #24

Closed balmydrizzle closed 7 years ago

balmydrizzle commented 8 years ago

警告: defalut dic path=file:\D:\solr-5.4.1\server\solr-webapp\webapp\WEB-INF\lib\mmseg4j-core-1.10.0.jar!\data not exist 資訊: try to load dir=file:\D:\solr-5.4.1\server\solr-webapp\webapp\WEB-INF\lib\mmseg4j-core-1.10.0.jar!\data Jul 05, 2016 4:22:50 上午 com.chenlb.mmseg4j.Dictionary loadDic 資訊: chars loaded time=21ms, line=12638, on file=file:\D:\solr-5.4.1\server\solr-webapp\webapp\WEB-INF\lib\mmseg4j-core-1.10.0.jar!\data\chars.dic ...

  <requestHandler name="/mmseg4j" class="com.chenlb.mmseg4j.solr.MMseg4jHandler" >
    <lst name="defaults">
      <str name="dicPath">mydic</str>
      <str name="check">true</str>
      <str name="reload">false</str>
      <str name="mode">simple</str>
    </lst>
  </requestHandler>

我有兩件事不解: (1) 字典目錄預設應該是在mmseg4j-core-1.10.0.jar裡面的data目錄,我也確定這個目錄和裡面的字典檔案確實存在,但是為何上面的警告訊息顯示"not exist". jar!的驚嘆號是什麼意思?我如果讓這個警告消失? (2) 在宣告request handler時,我預設了dicPath的值為mydic。為什麼上面訊息顯示出仍然是由jar檔中的dat目錄下讀取字典檔?另外mydic目錄應該建立在哪裡?

amao12580 commented 8 years ago

这行警告信息完全无用,如果出现类似以下日志,则表明默认的词库已经成功加载。

八月 04, 2016 7:48:25 上午 com.chenlb.mmseg4j.Dictionary loadDic 信息: chars loaded time=14ms, line=12638, on file=file:\F:\solr\server\solr\lib\ mmseg4j-core-1.10.2.jar!\data\chars.dic 八月 04, 2016 7:48:25 上午 com.chenlb.mmseg4j.Dictionary loadWord 信息: words loaded time=34ms, line=149852, on file=file:\F:\solr\server\solr\lib \mmseg4j-core-1.10.2.jar!\data\words.dic 八月 04, 2016 7:48:25 上午 com.chenlb.mmseg4j.Dictionary loadDic 信息: load all dic use time=60ms 八月 04, 2016 7:48:25 上午 com.chenl