(self, fieldname, text)
return idf
Calculates the Inverse Document Frequency of the current term (calls
        idf() on the searcher's Weighting object).
Calculates the Inverse Document Frequency of the current term (calls
        idf() on the searcher's Weighting object).
Calculates the Inverse Document Frequency of the current term ( calls idf () on the searcher s Weighting object ) .
def idf(self, fieldname, text):
        """Calculates the Inverse Document Frequency of the current term (calls
        idf() on the searcher's Weighting object).
        """

        # This method just calls the Weighting object's idf() method, but
        # caches the result. So Weighting objects should call *this* method
        # which will then call *their own* idf() methods.

        cache = self._idf_cache
        term = (fieldname, text)
        if term in cache:
            return cache[term]

        idf = self.weighting.idf(self, fieldname, text)
        cache[term] = idf
        return idf
def idf ( self , fieldname , text ) : # This method just calls the Weighting object's idf() method, but # caches the result. So Weighting objects should call *this* method # which will then call *their own* idf() methods. cache = self . _idf_cache term = ( fieldname , text ) if term in cache : return cache [ term ] idf = self . weighting . idf ( self , fieldname , text ) cache [ term ] = idf return idf