コード例 #1
0
 def addNewCluster(self, tf, sentence):
     """
     Creates a new cluster and adds it to the clusters.
     tf - term frequency counts of the given sentence
     sentence - sentence to be added to the cluster
     """
     self.newCID += 1
     newCluster = Cluster(self.newCID)
     newCluster.tf = tf
     newCluster.addSentenceToCluster(sentence)
     self.clusters[self.newCID] = newCluster
     print "Added new cluster for cid: {}".format(self.newCID)