def display(self):
        '''
        Displays statistics about our LM
        '''
        voc_list = []
        doc_ids = self.term_count_n.keys()
        doc_ids.sort()
        for doc_id in doc_ids:
            ngrams = len(self.term_count_n[doc_id]['ngrams'])
            print 'n-Grams (doc %s): %d' % (str(doc_id), ngrams)
            ngrams1 = len(self.term_count_n_1[doc_id]['ngrams'])
            print '(n-1)-Grams (doc %s): %d' % (str(doc_id), ngrams1)
            voc_list.append(ngrams)
        print 'Classed Vocabularies:', voc_list
        print ''
        corpus_ngrams = len(self.corpus_count_n['ngrams']) 
        print 'n-Grams (collection): %d' % (corpus_ngrams)
        corpus_ngrams1 = len(self.corpus_count_n_1['ngrams']) 
        print '(n-1)-Grams (collection): %d' % (corpus_ngrams1)
        self.unseen_counts.display()
def display ( self ) : voc_list = [ ] doc_ids = self . term_count_n . keys ( ) doc_ids . sort ( ) for doc_id in doc_ids : ngrams = len ( self . term_count_n [ doc_id ] [ 'ngrams' ] ) print 'n-Grams (doc %s): %d' % ( str ( doc_id ) , ngrams ) ngrams1 = len ( self . term_count_n_1 [ doc_id ] [ 'ngrams' ] ) print '(n-1)-Grams (doc %s): %d' % ( str ( doc_id ) , ngrams1 ) voc_list . append ( ngrams ) print 'Classed Vocabularies:' , voc_list print '' corpus_ngrams = len ( self . corpus_count_n [ 'ngrams' ] ) print 'n-Grams (collection): %d' % ( corpus_ngrams ) corpus_ngrams1 = len ( self . corpus_count_n_1 [ 'ngrams' ] ) print '(n-1)-Grams (collection): %d' % ( corpus_ngrams1 ) self . unseen_counts . display ( )
Displays statistics about our LM