nltk.collocations.QuadgramCollocationFinder¶
- class nltk.collocations.QuadgramCollocationFinder[source]¶
Bases:
AbstractCollocationFinder
A tool for the finding and ranking of quadgram collocations or other association measures. It is often useful to use from_words() rather than constructing an instance directly.
- default_ws = 4¶
- __init__(word_fd, quadgram_fd, ii, iii, ixi, ixxi, iixi, ixii)[source]¶
Construct a QuadgramCollocationFinder, given FreqDists for appearances of words, bigrams, trigrams, two words with one word and two words between them, three words with a word between them in both variations.
- above_score(score_fn, min_score)[source]¶
Returns a sequence of ngrams, ordered by decreasing score, whose scores each exceed the given minimum score.
- apply_freq_filter(min_freq)[source]¶
Removes candidate ngrams which have frequency less than min_freq.
- apply_ngram_filter(fn)[source]¶
Removes candidate ngrams (w1, w2, …) where fn(w1, w2, …) evaluates to True.
- apply_word_filter(fn)[source]¶
Removes candidate ngrams (w1, w2, …) where any of (fn(w1), fn(w2), …) evaluates to True.