'Generic filter removes ngrams from the frequency distribution
if the function returns True when passed an ngram tuple.'

def _apply_filter(self, fn=(lambda ngram, freq: False)):

    tmp_ngram = FreqDist()
    for (ngram, freq) in iteritems(self.ngram_fd):
        if (not fn(ngram, freq)):
            tmp_ngram[ngram] = freq
    self.ngram_fd = tmp_ngram
