Lucene中使用Paoding中文分词

 

1,把paoding-analysis-2.0.4-beta解压缩,给项目中加入paoding-analysis.jar。

2,把dic文件夹放到项目的根目录中。dic文件夹里是paoding的词库。

3,配置paoding的词库:把paoding-analysis-2.0.4-beta\src里面的paoding-dic-home.properties拷贝到项目的根目录下。编辑如下:

Xml代码 复制代码
  1. #values are "system-env" or "this";   
  2. #if value is "this" , using the paoding.dic.home as dicHome if configed!   
  3. #paoding.dic.home.config-fisrt=system-env   
  4. paoding.dic.home.config-fisrt=this  
  5. #dictionary home (directory)   
  6. #"classpath:xxx" means dictionary home is in classpath.   
  7. #e.g "classpath:dic" means dictionaries are in "classes/dic" directory or any other classpath directory   
  8. #paoding.dic.home=dic   
  9. paoding.dic.home=classpath:dic   
  10. #seconds for dic modification detection   
  11. #paoding.dic.detector.interval=60  

 

 

 

修改paoding .dic .home .config-fisrt=this ,使得程序知道该配置文件
修改paoding .dic .home =classpath:dic ,指定字典的所在路径。绝对路径也可以,但是不好。

 

 

http://code.google.com/p/paoding/downloads/list

 

 

posted on 2009-06-30 16:09  Squall  阅读(6880)  评论(0编辑  收藏  举报

导航