title: NLTK collocations for specific words
body: <p>I know how to get bigram and trigram collocations using NLTK and I apply them to my own corpora. The code is below. </p>
  
  <p>I'm not sure however about (1) how to get the collocations for a particular word? (2) does NLTK have a collocation metric based on Log-Likelihood Ratio?</p>
  
  <pre><code>import nltk
  from nltk.collocations import *
  from nltk.tokenize import word_tokenize
  
  text = "this is a foo bar bar black sheep  foo bar bar black sheep foo bar bar black  sheep shep bar bar black sentence"
  
  trigram_measures = nltk.collocations.TrigramAssocMeasures()
  finder = TrigramCollocationFinder.from_words(word_tokenize(text))
  
  for i in finder.score_ngrams(trigram_measures.pmi):
      print i
  </code></pre>