1. 依赖
<!-- https://mvnrepository.com/artifact/org.apache.lucene/lucene-core -->
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-core</artifactId>
<version>3.6.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.janeluo/ikanalyzer -->
<dependency>
<groupId>com.janeluo</groupId>
<artifactId>ikanalyzer</artifactId>
<version>2012_u6</version>
</dependency>
java案例
StringReader sr=new StringReader("兴业银行石家庄");
IKSegmenter ik=new IKSegmenter(sr, true);
Lexeme lex=null;
List<String> list = null;
try {
list = new ArrayList<>(16);
while((lex=ik.next())!=null){
list.add(lex.getLexemeText());
}
} catch (IOException e) {
}