将附件中的IKAnalyzer.cfg.xml内容更改,指向扩展自定义扩展词典的位置
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> 
<properties> 
    <comment>IK Analyzer 扩展配置</comment>
    <!--用户可以在这里配置自己的扩展字典 
    <entry key="ext_dict">/mydict.dic;</entry> 
    -->    
    <!--用户可以在这里配置自己的扩展停止词字典
    <entry key="ext_stopwords">/ext_stopword.dic</entry> 
    -->
</properties>
 扩展词典格式参考附件中ext_stopword.dic,
然后将配置文件,扩展词典放到classpath可以访问到的地方。
建议放在源代码根目录。

 

相关文章:

  • 2021-11-18
  • 2022-12-23
  • 2022-12-23
  • 2021-09-22
  • 2022-12-23
  • 2022-12-23
  • 2021-06-22
猜你喜欢
  • 2022-12-23
  • 2021-07-24
  • 2021-12-30
  • 2022-12-23
  • 2022-01-07
  • 2021-11-29
  • 2022-12-23
相关资源
相似解决方案