'Returns a list of all the [docname, similarity_score] pairs relative to a list of words.'

def similarities(self, list_of_words):

    query_dict = {}
    for w in list_of_words:
        query_dict[w] = (query_dict.get(w, 0.0) + 1.0)
    length = float(len(list_of_words))
    for k in query_dict:
        query_dict[k] = (query_dict[k] / length)
    sims = []
    for doc in self.documents:
        score = 0.0
        doc_dict = doc[1]
        for k in query_dict:
            if doc_dict.has_key(k):
                score += ((query_dict[k] / self.corpus_dict[k]) + (doc_dict[k] / self.corpus_dict[k]))
        sims.append([doc[0], score])
    return sims
