#NEWLINE# def analyze( self , text ) : #NEWLINE# #INDENT# 'Return the sentiment as a named tuple of the form:\n        ``Sentiment(classification, p_pos, p_neg)``\n        ' #NEWLINE# super ( NaiveBayesAnalyzer , self ) . analyze ( text ) #NEWLINE# tokens = word_tokenize ( text , include_punc = False ) #NEWLINE# filtered = ( t . lower ( ) for t in tokens if ( len ( t ) >= 3 ) ) #NEWLINE# feats = self . feature_extractor ( filtered ) #NEWLINE# prob_dist = self . _classifier . prob_classify ( feats ) #NEWLINE# return self . RETURN_TYPE ( classification = prob_dist . max ( ) , p_pos = prob_dist . prob ( 'pos' ) , p_neg = prob_dist . prob ( 'neg' ) )