Package nltk :: Module collocations :: Class TrigramCollocationFinder
[hide private]
[frames] | no frames]

type TrigramCollocationFinder

source code

               object --+    
                        |    
AbstractCollocationFinder --+
                            |
                           TrigramCollocationFinder

A tool for the finding and ranking of bigram collocations or other association measures. It is often useful to use from_words() rather than constructing an instance directly.

Instance Methods [hide private]
 
__init__(self, word_fd, bigram_fd, wildcard_fd, trigram_fd)
Construct a TrigramCollocationFinder, given FreqDists for appearances of words, bigrams, two words with any word between them, and trigrams.
source code
 
bigram_finder(self)
Constructs a bigram collocation finder with the bigram and unigram data from this finder.
source code
 
score_ngram(self, score_fn, w1, w2, w3)
Returns the score for a given trigram using the given scoring function.
source code

Inherited from AbstractCollocationFinder: above_score, apply_freq_filter, apply_ngram_filter, apply_word_filter, nbest, score_ngrams

Class Methods [hide private]
 
from_words(cls, words)
Construct a TrigramCollocationFinder for all trigrams in the given sequence.
source code

Inherited from AbstractCollocationFinder: from_documents

Static Methods [hide private]

Inherited from AbstractCollocationFinder (private): _ngram_freqdist

Method Details [hide private]

__init__(self, word_fd, bigram_fd, wildcard_fd, trigram_fd)
(Constructor)

source code 

Construct a TrigramCollocationFinder, given FreqDists for appearances of words, bigrams, two words with any word between them, and trigrams.

Overrides: AbstractCollocationFinder.__init__

bigram_finder(self)

source code 

Constructs a bigram collocation finder with the bigram and unigram data from this finder. Note that this does not include any filtering applied to this finder.