采用基于Java的开源搜索结果聚合引擎,Carrot2 2.0 中的后缀树算法
Carrot2 可以自动的把搜索结果归类到相应的语义类别中,这个功能是通过Carrot2一个现成的组件完成的,除此之外Carrot2 还包括了很多其他的搜索结果聚合聚类算法。
因为没有做中文分词,也没有中文的Stopword,所以我们用英文测试,实现代码
1
SnippetTokenizer snippetTokenizer = new SnippetTokenizer();
2
List<DocReference> documentReferences = new ArrayList<DocReference>();
3
List<TokenizedDocument> documents = new ArrayList<TokenizedDocument>();
4
TokenizedDocument doc = null;
5
DocReference documentReference = null;
6
7
//从搜索引擎google获取100篇数据
8
}
2
3
4
5
6
7
8
下面是输出聚类phone的结果,还不错
#phone
#Phone Number
#yellow pages
#mobile phone
#cell phone
#Phone Book
#area code
#Business
#services
#Wireless
#people
#directory
#telephone
#address
#online