title: iterate over bigrams(tuple) given by nltk : TypeError: 'NoneType' object is not iterable, Python
body: <p>I just started working with nltk and python, and I am having a small problem while iterating over the list of bigrams returned by nltk.</p>
  
  <p>Example of what I want:</p>
  
  <p>this is the list of bigrams:
  [('more', 'is'), ('is', 'said'), ('said', 'than'), ('than', 'done')]</p>
  
  <p>What I want is to be able to get each bigram : (more,is) and each term of each bigram:more, is etc separately  </p>
  
  <p>Here is what I tried so far, based on some answers in stackoverflow:</p>
  
  <pre><code>bigrams = nltk.bigrams(doclist)
  
  #method 1   
  for (a, b) in bigrams: #I get this error:  TypeError: 'NoneType' object is not iterable
      print a 
      print b 
  
  #method 2
  #convert to a list first 
  bigrams = list(bigrams)# I get the same error
  for (a, b) in bigrams:
      print a 
      print b
  
  #method 3
  #convert to a dict first
  dct = dict(tuples)# I get the same error
  </code></pre>
  
  <p>I assume that this bigrams are a list of tuples, so what am I doing wrong? </p>
  
  <p>Can you please point me out to any working code or tutorial. I will also be happy to accept any correct answer.</p>
  
  <p>Thank you in advance</p>
  
  <p>Note: I am working with python 2.7 </p>