@@ -0,0 +1,2402 @@
+package reciter.algorithm.cluster.similarity.clusteringstrategy.article;%0A%0Aimport java.util.List;%0Aimport java.util.Map;%0Aimport java.util.Set;%0A%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0Aimport reciter.algorithm.cluster.ReCiterClusterer;%0Aimport reciter.algorithm.cluster.clusteringstrategy.article.AbstractClusteringStrategy;%0Aimport reciter.algorithm.cluster.model.ReCiterCluster;%0Aimport reciter.model.article.ReCiterArticle;%0A%0A/**%0A * @author szd2013%0A * This strategy combines clusters based on features which are calculated by journal title, meshMajor and co-authors.%0A * Theory: these features generally occur fewer than 100,000 times in a corpus of 30 million records. We will use these merge articles into a single cluster but only when they occur a certain proportion of the time.%0A * General instructions: compare clusters to each other using the below features. If their similarity exceeds some threshold, combine the clusters.%0A * Rationale: Because these features may occur more often by chance, we do not automatically combine the clusters if they share the feature. Instead the cluster-cluster comparison needs to meet or exceed a scoring threshold (which is described below).%0A */%0Apublic class TepidClusteringStrategy extends AbstractClusteringStrategy %7B%0A%09%0A%09private static final Logger slf4jLogger = LoggerFactory.getLogger(TepidClusteringStrategy.class);%0A%09%0A%09@Override%0A%09public Map%3CLong, ReCiterCluster%3E cluster(List%3CReCiterArticle%3E reCiterArticles) %7B%0A%09%09// TODO Auto-generated method stub%0A%09%09return null;%0A%09%7D%0A%0A%09@Override%0A%09public Map%3CLong, ReCiterCluster%3E cluster(List%3CReCiterArticle%3E reCiterArticles, Set%3CLong%3E seedPmids) %7B%0A%09%09// TODO Auto-generated method stub%0A%09%09return null;%0A%09%7D%0A%0A%09@Override%0A%09public Map%3CLong, ReCiterCluster%3E cluster(Map%3CLong, ReCiterCluster%3E clusters) %7B%0A%09%09//Compare each clusters with all other for matching grant ID%0A%09%09long mapSize = ReCiterClusterer.baselineClusterSize;%0A%09%09for(long i=(long) 1 ; i %3C= mapSize ; i++) %7B%0A%09%09%09for(long j = (long) 1; j %3C= mapSize; j++) %7B%0A%09%09%09%09if(i==j) %7B%0A%09%09%09%09%09continue;%0A%09%09%09%09%7D%0A%09%09%09%09else %7B%0A%09%09%09%09%09if(clusters.get(i) != null && clusters.get(j) != null) %7B%0A%09%09%09%09%09%09if(clusters.get(i).compareTo(clusters.get(j), %22tepid%22) == 1) %7B%0A%09%09%09%09%09%09%09//slf4jLogger.info(%22Cluster %22 + i + %22 match with Cluster %22 + j);%0A%09%09%09%09%09%09%09clusters.get(i).addAll(clusters.get(j).getArticleCluster());%0A%09%09%09%09%09%09%09clusters.remove(j);%0A%09%09%09%09%09%09%7D%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D%0A%09%09%0A%09%09return clusters;%0A%09%7D%0A%0A%7D%0A

Implement Tepid clustering strategy