采用基于Java的开源搜索结果聚合引擎,Carrot2 2.0 中的后缀树算法
Carrot2 可以自动的把搜索结果归类到相应的语义类别中,这个功能是通过Carrot2一个现成的组件完成的,除此之外Carrot2 还包括了很多其他的搜索结果聚合聚类算法。

因为没有做中文分词,也没有中文的Stopword,所以我们用英文测试,实现代码

 1用开源Carrot2的后缀树算法做Web文本聚类SnippetTokenizer snippetTokenizer = new SnippetTokenizer(); 
 2用开源Carrot2的后缀树算法做Web文本聚类        List<DocReference> documentReferences = new ArrayList<DocReference>();       
 3用开源Carrot2的后缀树算法做Web文本聚类        List<TokenizedDocument> documents = new ArrayList<TokenizedDocument>();        
 4用开源Carrot2的后缀树算法做Web文本聚类        TokenizedDocument doc = null;
 5用开源Carrot2的后缀树算法做Web文本聚类        DocReference documentReference =  null;
 6用开源Carrot2的后缀树算法做Web文本聚类        
 7用开源Carrot2的后缀树算法做Web文本聚类        //从搜索引擎google获取100篇数据
 8        }


下面是输出聚类phone的结果,还不错
#phone
#Phone Number
#yellow pages
#mobile phone
#cell phone
#Phone Book
#area code
#Business
#services
#Wireless
#people
#directory
#telephone
#address
#online

相关文章: