看看这段代码,貌似可以啊
public static void main(String[] args) throws IOException, InvalidTokenOffsetsException {
List extendWords =new ArrayList();
extendWords.add("比特");
Dictionary.loadExtendStopWords(extendWords);
Analyzer analyzer = new IKAnalyzer();
TokenStream tokenStream = analyzer.tokenStream("",
new StringReader("丘比特"));
TermAttribute termAtt = (TermAttribute) tokenStream
.getAttribute(TermAttribute.class);
while (tokenStream.incrementToken()) {
System.out.print(termAtt.term());
System.out.print(' ');
}
}