(self, vector)
Adds forward-index information about one of the "top N" documents.

        :param vector: A series of (text, weight) tuples, such as is
            returned by Reader.vector_as("weight", docnum, fieldname).
Adds forward-index information about one of the "top N" documents.
Adds forward - index information about one of the top N documents .
def add(self, vector):
        """Adds forward-index information about one of the "top N" documents.

        :param vector: A series of (text, weight) tuples, such as is
            returned by Reader.vector_as("weight", docnum, fieldname).
        """

        total_weight = 0
        topN_weight = self.topN_weight

        for word, weight in vector:
            total_weight += weight
            topN_weight[word] += weight

        self.top_total += total_weight
def add ( self , vector ) : total_weight = 0 topN_weight = self . topN_weight for word , weight in vector : total_weight += weight topN_weight [ word ] += weight self . top_total += total_weight