'Returns the term frequency of a given word in the document (0.0-1.0).
tf = number of occurences of the word / number of words in document.
The more occurences of the word, the higher its relative tf weight.'

def term_frequency(self, word):

    return (float(self.terms.get(word, 0)) / (self.count or 1))
