赞
踩
private static Set segment(String text) throws Exception{ //text 为你要搜索的内容
Set<String> set = new HashSet<>();
StringReader re = new StringReader(text.trim());
IKSegmenter ik= new IKSegmenter(re,true);
Lexeme lex;
while((lex = ik.next())!=null){
set.add(lex.getLexemeText());
}
return set;
}
<dependency>
<groupId>com.janeluo</groupId>
<artifactId>ikanalyzer</artifactId>
<version>2012_u6</version>
</denpendency>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<comment>IK Analyzer 扩展配置</comment>
<entry key="ext_dict">ikConf/ext.dic;</entry>
<!--禁止搜索的-->
<entry key="ext_stopwords">ikConf/stopword.dic;</entry>
</properties>
车险理赔
财产险理赔
。。。
。。。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。